src/hotspot/share/opto/split_if.cpp
author roland
Tue, 01 Oct 2019 10:28:12 +0200
changeset 58470 8991796c17d4
parent 54027 a37939761ff6
permissions -rw-r--r--
8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode Reviewed-by: vlivanov, thartmann
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
49026
844bf1deff1a 8196884: VS2017 Multiple Type Cast Conversion Compilation Errors
lfoltan
parents: 48131
diff changeset
     2
 * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5024
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5024
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5024
diff changeset
    21
 * questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5901
diff changeset
    25
#include "precompiled.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5901
diff changeset
    26
#include "memory/allocation.inline.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5901
diff changeset
    27
#include "opto/callnode.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5901
diff changeset
    28
#include "opto/loopnode.hpp"
23528
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents: 13963
diff changeset
    29
#include "opto/movenode.hpp"
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
//------------------------------split_thru_region------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
// Split Node 'n' through merge point.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
Node *PhaseIdealLoop::split_thru_region( Node *n, Node *region ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
  uint wins = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
  assert( n->is_CFG(), "" );
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
  assert( region->is_Region(), "" );
24923
9631f7d691dc 8034812: remove IDX_INIT macro hack in Node class
thartmann
parents: 23528
diff changeset
    38
  Node *r = new RegionNode( region->req() );
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
  IdealLoopTree *loop = get_loop( n );
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
  for( uint i = 1; i < region->req(); i++ ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
    Node *x = n->clone();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
    Node *in0 = n->in(0);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
    if( in0->in(0) == region ) x->set_req( 0, in0->in(i) );
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
    for( uint j = 1; j < n->req(); j++ ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
      Node *in = n->in(j);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
      if( get_ctrl(in) == region )
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
        x->set_req( j, in->in(i) );
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
    _igvn.register_new_node_with_optimizer(x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
    set_loop(x, loop);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
    set_idom(x, x->in(0), dom_depth(x->in(0))+1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
    r->init_req(i, x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
  // Record region
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
  r->set_req(0,region);         // Not a TRUE RegionNode
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
  _igvn.register_new_node_with_optimizer(r);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
  set_loop(r, loop);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
  if( !loop->_child )
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
    loop->_body.push(r);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
  return r;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
//------------------------------split_up---------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
// Split block-local op up through the phis to empty the current block
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
bool PhaseIdealLoop::split_up( Node *n, Node *blk1, Node *blk2 ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
  if( n->is_CFG() ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
    assert( n->in(0) != blk1, "Lousy candidate for split-if" );
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
    return false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
  if( get_ctrl(n) != blk1 && get_ctrl(n) != blk2 )
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
    return false;               // Not block local
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
  if( n->is_Phi() ) return false; // Local PHIs are expected
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
  // Recursively split-up inputs
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
  for (uint i = 1; i < n->req(); i++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
    if( split_up( n->in(i), blk1, blk2 ) ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
      // Got split recursively and self went dead?
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
      if (n->outcnt() == 0)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
        _igvn.remove_dead_node(n);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
      return true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
  // Check for needing to clone-up a compare.  Can't do that, it forces
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
  // another (nested) split-if transform.  Instead, clone it "down".
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
  if( n->is_Cmp() ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
    assert(get_ctrl(n) == blk2 || get_ctrl(n) == blk1, "must be in block with IF");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
    // Check for simple Cmp/Bool/CMove which we can clone-up.  Cmp/Bool/CMove
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
    // sequence can have no other users and it must all reside in the split-if
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
    // block.  Non-simple Cmp/Bool/CMove sequences are 'cloned-down' below -
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
    // private, per-use versions of the Cmp and Bool are made.  These sink to
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
    // the CMove block.  If the CMove is in the split-if block, then in the
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
    // next iteration this will become a simple Cmp/Bool/CMove set to clone-up.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
    Node *bol, *cmov;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
    if( !(n->outcnt() == 1 && n->unique_out()->is_Bool() &&
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
          (bol = n->unique_out()->as_Bool()) &&
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
          (get_ctrl(bol) == blk1 ||
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
           get_ctrl(bol) == blk2) &&
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
          bol->outcnt() == 1 &&
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
          bol->unique_out()->is_CMove() &&
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
          (cmov = bol->unique_out()->as_CMove()) &&
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
          (get_ctrl(cmov) == blk1 ||
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
           get_ctrl(cmov) == blk2) ) ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
      // Must clone down
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
#ifndef PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
      if( PrintOpto && VerifyLoopOptimizations ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
        tty->print("Cloning down: ");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
        n->dump();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
#endif
58470
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   113
      if (!n->is_FastLock()) {
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   114
        // Clone down any block-local BoolNode uses of this CmpNode
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   115
        for (DUIterator i = n->outs(); n->has_out(i); i++) {
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   116
          Node* bol = n->out(i);
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   117
          assert( bol->is_Bool(), "" );
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   118
          if (bol->outcnt() == 1) {
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   119
            Node* use = bol->unique_out();
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   120
            if (use->Opcode() == Op_Opaque4) {
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   121
              if (use->outcnt() == 1) {
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   122
                Node* iff = use->unique_out();
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   123
                assert(iff->is_If(), "unexpected node type");
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   124
                Node *use_c = iff->in(0);
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   125
                if (use_c == blk1 || use_c == blk2) {
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   126
                  continue;
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   127
                }
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   128
              }
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   129
            } else {
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   130
              // We might see an Opaque1 from a loop limit check here
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   131
              assert(use->is_If() || use->is_CMove() || use->Opcode() == Op_Opaque1, "unexpected node type");
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   132
              Node *use_c = use->is_If() ? use->in(0) : get_ctrl(use);
47820
1bc021ddeae0 8186125: "DU iteration must converge quickly" assert in split if with unsafe accesses
roland
parents: 47216
diff changeset
   133
              if (use_c == blk1 || use_c == blk2) {
58470
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   134
                assert(use->is_CMove(), "unexpected node type");
47820
1bc021ddeae0 8186125: "DU iteration must converge quickly" assert in split if with unsafe accesses
roland
parents: 47216
diff changeset
   135
                continue;
1bc021ddeae0 8186125: "DU iteration must converge quickly" assert in split if with unsafe accesses
roland
parents: 47216
diff changeset
   136
              }
1bc021ddeae0 8186125: "DU iteration must converge quickly" assert in split if with unsafe accesses
roland
parents: 47216
diff changeset
   137
            }
58470
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   138
          }
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   139
          if (get_ctrl(bol) == blk1 || get_ctrl(bol) == blk2) {
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   140
            // Recursively sink any BoolNode
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   141
#ifndef PRODUCT
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   142
            if( PrintOpto && VerifyLoopOptimizations ) {
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   143
              tty->print("Cloning down: ");
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   144
              bol->dump();
47820
1bc021ddeae0 8186125: "DU iteration must converge quickly" assert in split if with unsafe accesses
roland
parents: 47216
diff changeset
   145
            }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
#endif
58470
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   147
            for (DUIterator j = bol->outs(); bol->has_out(j); j++) {
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   148
              Node* u = bol->out(j);
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   149
              // Uses are either IfNodes, CMoves or Opaque4
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   150
              if (u->Opcode() == Op_Opaque4) {
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   151
                assert(u->in(1) == bol, "bad input");
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   152
                for (DUIterator_Last kmin, k = u->last_outs(kmin); k >= kmin; --k) {
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   153
                  Node* iff = u->last_out(k);
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   154
                  assert(iff->is_If() || iff->is_CMove(), "unexpected node type");
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   155
                  assert( iff->in(1) == u, "" );
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   156
                  // Get control block of either the CMove or the If input
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   157
                  Node *iff_ctrl = iff->is_If() ? iff->in(0) : get_ctrl(iff);
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   158
                  Node *x1 = bol->clone();
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   159
                  Node *x2 = u->clone();
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   160
                  register_new_node(x1, iff_ctrl);
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   161
                  register_new_node(x2, iff_ctrl);
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   162
                  _igvn.replace_input_of(x2, 1, x1);
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   163
                  _igvn.replace_input_of(iff, 1, x2);
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   164
                }
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   165
                _igvn.remove_dead_node(u);
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   166
                --j;
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   167
              } else {
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   168
                // We might see an Opaque1 from a loop limit check here
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   169
                assert(u->is_If() || u->is_CMove() || u->Opcode() == Op_Opaque1, "unexpected node type");
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   170
                assert(u->in(1) == bol, "");
47820
1bc021ddeae0 8186125: "DU iteration must converge quickly" assert in split if with unsafe accesses
roland
parents: 47216
diff changeset
   171
                // Get control block of either the CMove or the If input
58470
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   172
                Node *u_ctrl = u->is_If() ? u->in(0) : get_ctrl(u);
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   173
                assert((u_ctrl != blk1 && u_ctrl != blk2) || u->is_CMove(), "won't converge");
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   174
                Node *x = bol->clone();
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   175
                register_new_node(x, u_ctrl);
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   176
                _igvn.replace_input_of(u, 1, x);
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   177
                --j;
47820
1bc021ddeae0 8186125: "DU iteration must converge quickly" assert in split if with unsafe accesses
roland
parents: 47216
diff changeset
   178
              }
1bc021ddeae0 8186125: "DU iteration must converge quickly" assert in split if with unsafe accesses
roland
parents: 47216
diff changeset
   179
            }
58470
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   180
            _igvn.remove_dead_node(bol);
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   181
            --i;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
          }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
      // Clone down this CmpNode
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
      for (DUIterator_Last jmin, j = n->last_outs(jmin); j >= jmin; --j) {
58470
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   187
        Node* use = n->last_out(j);
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   188
        uint pos = 1;
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   189
        if (n->is_FastLock()) {
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   190
          pos = TypeFunc::Parms + 2;
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   191
          assert(use->is_Lock(), "FastLock only used by LockNode");
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   192
        }
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   193
        assert(use->in(pos) == n, "" );
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
        Node *x = n->clone();
58470
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   195
        register_new_node(x, ctrl_or_self(use));
8991796c17d4 8231620: assert(bol->is_Bool()) crash during split if due to FastLockNode
roland
parents: 54027
diff changeset
   196
        _igvn.replace_input_of(use, pos, x);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
      _igvn.remove_dead_node( n );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
      return true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
  // See if splitting-up a Store.  Any anti-dep loads must go up as
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
  // well.  An anti-dep load might be in the wrong block, because in
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
  // this particular layout/schedule we ignored anti-deps and allow
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
  // memory to be alive twice.  This only works if we do the same
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
  // operations on anti-dep loads as we do their killing stores.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
  if( n->is_Store() && n->in(MemNode::Memory)->in(0) == n->in(0) ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
    // Get store's memory slice
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
    int alias_idx = C->get_alias_index(_igvn.type(n->in(MemNode::Address))->is_ptr());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
    // Get memory-phi anti-dep loads will be using
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
    Node *memphi = n->in(MemNode::Memory);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
    assert( memphi->is_Phi(), "" );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
    // Hoist any anti-dep load to the splitting block;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
    // it will then "split-up".
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
    for (DUIterator_Fast imax,i = memphi->fast_outs(imax); i < imax; i++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
      Node *load = memphi->fast_out(i);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
      if( load->is_Load() && alias_idx == C->get_alias_index(_igvn.type(load->in(MemNode::Address))->is_ptr()) )
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
        set_ctrl(load,blk1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
  // Found some other Node; must clone it up
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
#ifndef PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
  if( PrintOpto && VerifyLoopOptimizations ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
    tty->print("Cloning up: ");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
    n->dump();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
5024
d7ac73e48389 6663854: assert(n != __null,"Bad immediate dominator info.") in C2 with -Xcomp
never
parents: 4643
diff changeset
   233
  // ConvI2L may have type information on it which becomes invalid if
d7ac73e48389 6663854: assert(n != __null,"Bad immediate dominator info.") in C2 with -Xcomp
never
parents: 4643
diff changeset
   234
  // it moves up in the graph so change any clones so widen the type
d7ac73e48389 6663854: assert(n != __null,"Bad immediate dominator info.") in C2 with -Xcomp
never
parents: 4643
diff changeset
   235
  // to TypeLong::INT when pushing it up.
d7ac73e48389 6663854: assert(n != __null,"Bad immediate dominator info.") in C2 with -Xcomp
never
parents: 4643
diff changeset
   236
  const Type* rtype = NULL;
d7ac73e48389 6663854: assert(n != __null,"Bad immediate dominator info.") in C2 with -Xcomp
never
parents: 4643
diff changeset
   237
  if (n->Opcode() == Op_ConvI2L && n->bottom_type() != TypeLong::INT) {
d7ac73e48389 6663854: assert(n != __null,"Bad immediate dominator info.") in C2 with -Xcomp
never
parents: 4643
diff changeset
   238
    rtype = TypeLong::INT;
d7ac73e48389 6663854: assert(n != __null,"Bad immediate dominator info.") in C2 with -Xcomp
never
parents: 4643
diff changeset
   239
  }
d7ac73e48389 6663854: assert(n != __null,"Bad immediate dominator info.") in C2 with -Xcomp
never
parents: 4643
diff changeset
   240
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   241
  // Now actually split-up this guy.  One copy per control path merging.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   242
  Node *phi = PhiNode::make_blank(blk1, n);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
  for( uint j = 1; j < blk1->req(); j++ ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   244
    Node *x = n->clone();
5024
d7ac73e48389 6663854: assert(n != __null,"Bad immediate dominator info.") in C2 with -Xcomp
never
parents: 4643
diff changeset
   245
    // Widen the type of the ConvI2L when pushing up.
d7ac73e48389 6663854: assert(n != __null,"Bad immediate dominator info.") in C2 with -Xcomp
never
parents: 4643
diff changeset
   246
    if (rtype != NULL) x->as_Type()->set_type(rtype);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
    if( n->in(0) && n->in(0) == blk1 )
489c9b5090e2 Initial load
duke
parents:
diff changeset
   248
      x->set_req( 0, blk1->in(j) );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   249
    for( uint i = 1; i < n->req(); i++ ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   250
      Node *m = n->in(i);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   251
      if( get_ctrl(m) == blk1 ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   252
        assert( m->in(0) == blk1, "" );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   253
        x->set_req( i, m->in(j) );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   254
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   255
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   256
    register_new_node( x, blk1->in(j) );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   257
    phi->init_req( j, x );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   258
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   259
  // Announce phi to optimizer
489c9b5090e2 Initial load
duke
parents:
diff changeset
   260
  register_new_node(phi, blk1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   261
489c9b5090e2 Initial load
duke
parents:
diff changeset
   262
  // Remove cloned-up value from optimizer; use phi instead
5901
c046f8e9c52b 6677629: PhaseIterGVN::subsume_node() should call hash_delete() and add_users_to_worklist()
kvn
parents: 5547
diff changeset
   263
  _igvn.replace_node( n, phi );
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   264
489c9b5090e2 Initial load
duke
parents:
diff changeset
   265
  // (There used to be a self-recursive call to split_up() here,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   266
  // but it is not needed.  All necessary forward walking is done
489c9b5090e2 Initial load
duke
parents:
diff changeset
   267
  // by do_split_if() below.)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   268
489c9b5090e2 Initial load
duke
parents:
diff changeset
   269
  return true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   270
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   271
489c9b5090e2 Initial load
duke
parents:
diff changeset
   272
//------------------------------register_new_node------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   273
void PhaseIdealLoop::register_new_node( Node *n, Node *blk ) {
4643
61c659c91c57 6894779: Loop Predication for Loop Optimizer in C2
cfang
parents: 2131
diff changeset
   274
  assert(!n->is_CFG(), "must be data node");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   275
  _igvn.register_new_node_with_optimizer(n);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   276
  set_ctrl(n, blk);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   277
  IdealLoopTree *loop = get_loop(blk);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   278
  if( !loop->_child )
489c9b5090e2 Initial load
duke
parents:
diff changeset
   279
    loop->_body.push(n);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   280
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   281
489c9b5090e2 Initial load
duke
parents:
diff changeset
   282
//------------------------------small_cache------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   283
struct small_cache : public Dict {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   284
489c9b5090e2 Initial load
duke
parents:
diff changeset
   285
  small_cache() : Dict( cmpkey, hashptr ) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   286
  Node *probe( Node *use_blk ) { return (Node*)((*this)[use_blk]); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   287
  void lru_insert( Node *use_blk, Node *new_def ) { Insert(use_blk,new_def); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   288
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   289
489c9b5090e2 Initial load
duke
parents:
diff changeset
   290
//------------------------------spinup-----------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   291
// "Spin up" the dominator tree, starting at the use site and stopping when we
489c9b5090e2 Initial load
duke
parents:
diff changeset
   292
// find the post-dominating point.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   293
489c9b5090e2 Initial load
duke
parents:
diff changeset
   294
// We must be at the merge point which post-dominates 'new_false' and
489c9b5090e2 Initial load
duke
parents:
diff changeset
   295
// 'new_true'.  Figure out which edges into the RegionNode eventually lead up
489c9b5090e2 Initial load
duke
parents:
diff changeset
   296
// to false and which to true.  Put in a PhiNode to merge values; plug in
489c9b5090e2 Initial load
duke
parents:
diff changeset
   297
// the appropriate false-arm or true-arm values.  If some path leads to the
489c9b5090e2 Initial load
duke
parents:
diff changeset
   298
// original IF, then insert a Phi recursively.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   299
Node *PhaseIdealLoop::spinup( Node *iff_dom, Node *new_false, Node *new_true, Node *use_blk, Node *def, small_cache *cache ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   300
  if (use_blk->is_top())        // Handle dead uses
489c9b5090e2 Initial load
duke
parents:
diff changeset
   301
    return use_blk;
49026
844bf1deff1a 8196884: VS2017 Multiple Type Cast Conversion Compilation Errors
lfoltan
parents: 48131
diff changeset
   302
  Node *prior_n = (Node*)((intptr_t)0xdeadbeef);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   303
  Node *n = use_blk;            // Get path input
489c9b5090e2 Initial load
duke
parents:
diff changeset
   304
  assert( use_blk != iff_dom, "" );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   305
  // Here's the "spinup" the dominator tree loop.  Do a cache-check
489c9b5090e2 Initial load
duke
parents:
diff changeset
   306
  // along the way, in case we've come this way before.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   307
  while( n != iff_dom ) {       // Found post-dominating point?
489c9b5090e2 Initial load
duke
parents:
diff changeset
   308
    prior_n = n;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   309
    n = idom(n);                // Search higher
489c9b5090e2 Initial load
duke
parents:
diff changeset
   310
    Node *s = cache->probe( prior_n ); // Check cache
489c9b5090e2 Initial load
duke
parents:
diff changeset
   311
    if( s ) return s;           // Cache hit!
489c9b5090e2 Initial load
duke
parents:
diff changeset
   312
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   313
489c9b5090e2 Initial load
duke
parents:
diff changeset
   314
  Node *phi_post;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   315
  if( prior_n == new_false || prior_n == new_true ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   316
    phi_post = def->clone();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   317
    phi_post->set_req(0, prior_n );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   318
    register_new_node(phi_post, prior_n);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   319
  } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   320
    // This method handles both control uses (looking for Regions) or data
489c9b5090e2 Initial load
duke
parents:
diff changeset
   321
    // uses (looking for Phis).  If looking for a control use, then we need
489c9b5090e2 Initial load
duke
parents:
diff changeset
   322
    // to insert a Region instead of a Phi; however Regions always exist
489c9b5090e2 Initial load
duke
parents:
diff changeset
   323
    // previously (the hash_find_insert below would always hit) so we can
489c9b5090e2 Initial load
duke
parents:
diff changeset
   324
    // return the existing Region.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   325
    if( def->is_CFG() ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   326
      phi_post = prior_n;       // If looking for CFG, return prior
489c9b5090e2 Initial load
duke
parents:
diff changeset
   327
    } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   328
      assert( def->is_Phi(), "" );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   329
      assert( prior_n->is_Region(), "must be a post-dominating merge point" );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   330
489c9b5090e2 Initial load
duke
parents:
diff changeset
   331
      // Need a Phi here
489c9b5090e2 Initial load
duke
parents:
diff changeset
   332
      phi_post = PhiNode::make_blank(prior_n, def);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   333
      // Search for both true and false on all paths till find one.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   334
      for( uint i = 1; i < phi_post->req(); i++ ) // For all paths
489c9b5090e2 Initial load
duke
parents:
diff changeset
   335
        phi_post->init_req( i, spinup( iff_dom, new_false, new_true, prior_n->in(i), def, cache ) );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   336
      Node *t = _igvn.hash_find_insert(phi_post);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   337
      if( t ) {                 // See if we already have this one
489c9b5090e2 Initial load
duke
parents:
diff changeset
   338
        // phi_post will not be used, so kill it
489c9b5090e2 Initial load
duke
parents:
diff changeset
   339
        _igvn.remove_dead_node(phi_post);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   340
        phi_post->destruct();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   341
        phi_post = t;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   342
      } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   343
        register_new_node( phi_post, prior_n );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   344
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   345
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   346
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   347
489c9b5090e2 Initial load
duke
parents:
diff changeset
   348
  // Update cache everywhere
49026
844bf1deff1a 8196884: VS2017 Multiple Type Cast Conversion Compilation Errors
lfoltan
parents: 48131
diff changeset
   349
  prior_n = (Node*)((intptr_t)0xdeadbeef);  // Reset IDOM walk
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   350
  n = use_blk;                  // Get path input
489c9b5090e2 Initial load
duke
parents:
diff changeset
   351
  // Spin-up the idom tree again, basically doing path-compression.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   352
  // Insert cache entries along the way, so that if we ever hit this
489c9b5090e2 Initial load
duke
parents:
diff changeset
   353
  // point in the IDOM tree again we'll stop immediately on a cache hit.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   354
  while( n != iff_dom ) {       // Found post-dominating point?
489c9b5090e2 Initial load
duke
parents:
diff changeset
   355
    prior_n = n;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   356
    n = idom(n);                // Search higher
489c9b5090e2 Initial load
duke
parents:
diff changeset
   357
    cache->lru_insert( prior_n, phi_post ); // Fill cache
489c9b5090e2 Initial load
duke
parents:
diff changeset
   358
  } // End of while not gone high enough
489c9b5090e2 Initial load
duke
parents:
diff changeset
   359
489c9b5090e2 Initial load
duke
parents:
diff changeset
   360
  return phi_post;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   361
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   362
489c9b5090e2 Initial load
duke
parents:
diff changeset
   363
//------------------------------find_use_block---------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   364
// Find the block a USE is in.  Normally USE's are in the same block as the
489c9b5090e2 Initial load
duke
parents:
diff changeset
   365
// using instruction.  For Phi-USE's, the USE is in the predecessor block
489c9b5090e2 Initial load
duke
parents:
diff changeset
   366
// along the corresponding path.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   367
Node *PhaseIdealLoop::find_use_block( Node *use, Node *def, Node *old_false, Node *new_false, Node *old_true, Node *new_true ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   368
  // CFG uses are their own block
489c9b5090e2 Initial load
duke
parents:
diff changeset
   369
  if( use->is_CFG() )
489c9b5090e2 Initial load
duke
parents:
diff changeset
   370
    return use;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   371
489c9b5090e2 Initial load
duke
parents:
diff changeset
   372
  if( use->is_Phi() ) {         // Phi uses in prior block
489c9b5090e2 Initial load
duke
parents:
diff changeset
   373
    // Grab the first Phi use; there may be many.
2131
98f9cef66a34 6810672: Comment typos
twisti
parents: 1
diff changeset
   374
    // Each will be handled as a separate iteration of
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   375
    // the "while( phi->outcnt() )" loop.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   376
    uint j;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   377
    for( j = 1; j < use->req(); j++ )
489c9b5090e2 Initial load
duke
parents:
diff changeset
   378
      if( use->in(j) == def )
489c9b5090e2 Initial load
duke
parents:
diff changeset
   379
        break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   380
    assert( j < use->req(), "def should be among use's inputs" );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   381
    return use->in(0)->in(j);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   382
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   383
  // Normal (non-phi) use
489c9b5090e2 Initial load
duke
parents:
diff changeset
   384
  Node *use_blk = get_ctrl(use);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   385
  // Some uses are directly attached to the old (and going away)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   386
  // false and true branches.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   387
  if( use_blk == old_false ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   388
    use_blk = new_false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   389
    set_ctrl(use, new_false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   390
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   391
  if( use_blk == old_true ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   392
    use_blk = new_true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   393
    set_ctrl(use, new_true);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   394
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   395
489c9b5090e2 Initial load
duke
parents:
diff changeset
   396
  if (use_blk == NULL) {        // He's dead, Jim
5901
c046f8e9c52b 6677629: PhaseIterGVN::subsume_node() should call hash_delete() and add_users_to_worklist()
kvn
parents: 5547
diff changeset
   397
    _igvn.replace_node(use, C->top());
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   398
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   399
489c9b5090e2 Initial load
duke
parents:
diff changeset
   400
  return use_blk;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   401
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   402
489c9b5090e2 Initial load
duke
parents:
diff changeset
   403
//------------------------------handle_use-------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   404
// Handle uses of the merge point.  Basically, split-if makes the merge point
489c9b5090e2 Initial load
duke
parents:
diff changeset
   405
// go away so all uses of the merge point must go away as well.  Most block
489c9b5090e2 Initial load
duke
parents:
diff changeset
   406
// local uses have already been split-up, through the merge point.  Uses from
489c9b5090e2 Initial load
duke
parents:
diff changeset
   407
// far below the merge point can't always be split up (e.g., phi-uses are
489c9b5090e2 Initial load
duke
parents:
diff changeset
   408
// pinned) and it makes too much stuff live.  Instead we use a path-based
489c9b5090e2 Initial load
duke
parents:
diff changeset
   409
// solution to move uses down.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   410
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   411
// If the use is along the pre-split-CFG true branch, then the new use will
489c9b5090e2 Initial load
duke
parents:
diff changeset
   412
// be from the post-split-CFG true merge point.  Vice-versa for the false
489c9b5090e2 Initial load
duke
parents:
diff changeset
   413
// path.  Some uses will be along both paths; then we sink the use to the
489c9b5090e2 Initial load
duke
parents:
diff changeset
   414
// post-dominating location; we may need to insert a Phi there.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   415
void PhaseIdealLoop::handle_use( Node *use, Node *def, small_cache *cache, Node *region_dom, Node *new_false, Node *new_true, Node *old_false, Node *old_true ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   416
489c9b5090e2 Initial load
duke
parents:
diff changeset
   417
  Node *use_blk = find_use_block(use,def,old_false,new_false,old_true,new_true);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   418
  if( !use_blk ) return;        // He's dead, Jim
489c9b5090e2 Initial load
duke
parents:
diff changeset
   419
489c9b5090e2 Initial load
duke
parents:
diff changeset
   420
  // Walk up the dominator tree until I hit either the old IfFalse, the old
489c9b5090e2 Initial load
duke
parents:
diff changeset
   421
  // IfTrue or the old If.  Insert Phis where needed.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   422
  Node *new_def = spinup( region_dom, new_false, new_true, use_blk, def, cache );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   423
489c9b5090e2 Initial load
duke
parents:
diff changeset
   424
  // Found where this USE goes.  Re-point him.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   425
  uint i;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   426
  for( i = 0; i < use->req(); i++ )
489c9b5090e2 Initial load
duke
parents:
diff changeset
   427
    if( use->in(i) == def )
489c9b5090e2 Initial load
duke
parents:
diff changeset
   428
      break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   429
  assert( i < use->req(), "def should be among use's inputs" );
12958
009b6c9586d8 7173340: C2: code cleanup: use PhaseIterGVN::replace_edge(Node*, int, Node*) where applicable
kvn
parents: 10502
diff changeset
   430
  _igvn.replace_input_of(use, i, new_def);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   431
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   432
489c9b5090e2 Initial load
duke
parents:
diff changeset
   433
//------------------------------do_split_if------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   434
// Found an If getting its condition-code input from a Phi in the same block.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   435
// Split thru the Region.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   436
void PhaseIdealLoop::do_split_if( Node *iff ) {
34174
4db2fb26dc49 8140424: don't prefix developer and notproduct flag variables with CONST_ in product builds
twisti
parents: 24923
diff changeset
   437
  if (PrintOpto && VerifyLoopOptimizations) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   438
    tty->print_cr("Split-if");
34174
4db2fb26dc49 8140424: don't prefix developer and notproduct flag variables with CONST_ in product builds
twisti
parents: 24923
diff changeset
   439
  }
9101
ff58f9a8e31c 7004535: Clone loop predicate during loop unswitch
kvn
parents: 7397
diff changeset
   440
  if (TraceLoopOpts) {
ff58f9a8e31c 7004535: Clone loop predicate during loop unswitch
kvn
parents: 7397
diff changeset
   441
    tty->print_cr("SplitIf");
ff58f9a8e31c 7004535: Clone loop predicate during loop unswitch
kvn
parents: 7397
diff changeset
   442
  }
34174
4db2fb26dc49 8140424: don't prefix developer and notproduct flag variables with CONST_ in product builds
twisti
parents: 24923
diff changeset
   443
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   444
  C->set_major_progress();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   445
  Node *region = iff->in(0);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   446
  Node *region_dom = idom(region);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   447
489c9b5090e2 Initial load
duke
parents:
diff changeset
   448
  // We are going to clone this test (and the control flow with it) up through
489c9b5090e2 Initial load
duke
parents:
diff changeset
   449
  // the incoming merge point.  We need to empty the current basic block.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   450
  // Clone any instructions which must be in this block up through the merge
489c9b5090e2 Initial load
duke
parents:
diff changeset
   451
  // point.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   452
  DUIterator i, j;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   453
  bool progress = true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   454
  while (progress) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   455
    progress = false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   456
    for (i = region->outs(); region->has_out(i); i++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   457
      Node* n = region->out(i);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   458
      if( n == region ) continue;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   459
      // The IF to be split is OK.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   460
      if( n == iff ) continue;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   461
      if( !n->is_Phi() ) {      // Found pinned memory op or such
489c9b5090e2 Initial load
duke
parents:
diff changeset
   462
        if (split_up(n, region, iff)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   463
          i = region->refresh_out_pos(i);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   464
          progress = true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   465
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   466
        continue;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   467
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   468
      assert( n->in(0) == region, "" );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   469
489c9b5090e2 Initial load
duke
parents:
diff changeset
   470
      // Recursively split up all users of a Phi
489c9b5090e2 Initial load
duke
parents:
diff changeset
   471
      for (j = n->outs(); n->has_out(j); j++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   472
        Node* m = n->out(j);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   473
        // If m is dead, throw it away, and declare progress
489c9b5090e2 Initial load
duke
parents:
diff changeset
   474
        if (_nodes[m->_idx] == NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   475
          _igvn.remove_dead_node(m);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   476
          // fall through
489c9b5090e2 Initial load
duke
parents:
diff changeset
   477
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   478
        else if (m != iff && split_up(m, region, iff)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   479
          // fall through
489c9b5090e2 Initial load
duke
parents:
diff changeset
   480
        } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   481
          continue;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   482
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   483
        // Something unpredictable changed.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   484
        // Tell the iterators to refresh themselves, and rerun the loop.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   485
        i = region->refresh_out_pos(i);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   486
        j = region->refresh_out_pos(j);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   487
        progress = true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   488
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   489
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   490
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   491
489c9b5090e2 Initial load
duke
parents:
diff changeset
   492
  // Now we have no instructions in the block containing the IF.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   493
  // Split the IF.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   494
  Node *new_iff = split_thru_region( iff, region );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   495
489c9b5090e2 Initial load
duke
parents:
diff changeset
   496
  // Replace both uses of 'new_iff' with Regions merging True/False
489c9b5090e2 Initial load
duke
parents:
diff changeset
   497
  // paths.  This makes 'new_iff' go dead.
33589
7cbd1b2c139b 8139040: Fix initializations before ShouldNotReachHere() etc. and enable -Wuninitialized on linux.
goetz
parents: 24923
diff changeset
   498
  Node *old_false = NULL, *old_true = NULL;
7cbd1b2c139b 8139040: Fix initializations before ShouldNotReachHere() etc. and enable -Wuninitialized on linux.
goetz
parents: 24923
diff changeset
   499
  Node *new_false = NULL, *new_true = NULL;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   500
  for (DUIterator_Last j2min, j2 = iff->last_outs(j2min); j2 >= j2min; --j2) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   501
    Node *ifp = iff->last_out(j2);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   502
    assert( ifp->Opcode() == Op_IfFalse || ifp->Opcode() == Op_IfTrue, "" );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   503
    ifp->set_req(0, new_iff);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   504
    Node *ifpx = split_thru_region( ifp, region );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   505
489c9b5090e2 Initial load
duke
parents:
diff changeset
   506
    // Replace 'If' projection of a Region with a Region of
489c9b5090e2 Initial load
duke
parents:
diff changeset
   507
    // 'If' projections.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   508
    ifpx->set_req(0, ifpx);       // A TRUE RegionNode
489c9b5090e2 Initial load
duke
parents:
diff changeset
   509
489c9b5090e2 Initial load
duke
parents:
diff changeset
   510
    // Setup dominator info
489c9b5090e2 Initial load
duke
parents:
diff changeset
   511
    set_idom(ifpx, region_dom, dom_depth(region_dom) + 1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   512
489c9b5090e2 Initial load
duke
parents:
diff changeset
   513
    // Check for splitting loop tails
489c9b5090e2 Initial load
duke
parents:
diff changeset
   514
    if( get_loop(iff)->tail() == ifp )
489c9b5090e2 Initial load
duke
parents:
diff changeset
   515
      get_loop(iff)->_tail = ifpx;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   516
489c9b5090e2 Initial load
duke
parents:
diff changeset
   517
    // Replace in the graph with lazy-update mechanism
489c9b5090e2 Initial load
duke
parents:
diff changeset
   518
    new_iff->set_req(0, new_iff); // hook self so it does not go dead
35759
85d3873f87b4 8147645: get_ctrl_no_update() code is wrong
roland
parents: 34185
diff changeset
   519
    lazy_replace(ifp, ifpx);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   520
    new_iff->set_req(0, region);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   521
489c9b5090e2 Initial load
duke
parents:
diff changeset
   522
    // Record bits for later xforms
489c9b5090e2 Initial load
duke
parents:
diff changeset
   523
    if( ifp->Opcode() == Op_IfFalse ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   524
      old_false = ifp;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   525
      new_false = ifpx;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   526
    } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   527
      old_true = ifp;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   528
      new_true = ifpx;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   529
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   530
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   531
  _igvn.remove_dead_node(new_iff);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   532
  // Lazy replace IDOM info with the region's dominator
54027
a37939761ff6 8219448: split-if update_uses accesses stale idom data
neliasso
parents: 49026
diff changeset
   533
  lazy_replace(iff, region_dom);
a37939761ff6 8219448: split-if update_uses accesses stale idom data
neliasso
parents: 49026
diff changeset
   534
  lazy_update(region, region_dom); // idom must be update before handle_uses
a37939761ff6 8219448: split-if update_uses accesses stale idom data
neliasso
parents: 49026
diff changeset
   535
  region->set_req(0, NULL);        // Break the self-cycle. Required for lazy_update to work on region
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   536
489c9b5090e2 Initial load
duke
parents:
diff changeset
   537
  // Now make the original merge point go dead, by handling all its uses.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   538
  small_cache region_cache;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   539
  // Preload some control flow in region-cache
489c9b5090e2 Initial load
duke
parents:
diff changeset
   540
  region_cache.lru_insert( new_false, new_false );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   541
  region_cache.lru_insert( new_true , new_true  );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   542
  // Now handle all uses of the splitting block
10502
17598114b94c 6591247: C2 cleans up the merge point too early during SplitIf
iveresov
parents: 9101
diff changeset
   543
  for (DUIterator k = region->outs(); region->has_out(k); k++) {
17598114b94c 6591247: C2 cleans up the merge point too early during SplitIf
iveresov
parents: 9101
diff changeset
   544
    Node* phi = region->out(k);
17598114b94c 6591247: C2 cleans up the merge point too early during SplitIf
iveresov
parents: 9101
diff changeset
   545
    if (!phi->in(0)) {         // Dead phi?  Remove it
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   546
      _igvn.remove_dead_node(phi);
10502
17598114b94c 6591247: C2 cleans up the merge point too early during SplitIf
iveresov
parents: 9101
diff changeset
   547
    } else if (phi == region) { // Found the self-reference
17598114b94c 6591247: C2 cleans up the merge point too early during SplitIf
iveresov
parents: 9101
diff changeset
   548
      continue;                 // No roll-back of DUIterator
17598114b94c 6591247: C2 cleans up the merge point too early during SplitIf
iveresov
parents: 9101
diff changeset
   549
    } else if (phi->is_Phi()) { // Expected common case: Phi hanging off of Region
17598114b94c 6591247: C2 cleans up the merge point too early during SplitIf
iveresov
parents: 9101
diff changeset
   550
      assert(phi->in(0) == region, "Inconsistent graph");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   551
      // Need a per-def cache.  Phi represents a def, so make a cache
489c9b5090e2 Initial load
duke
parents:
diff changeset
   552
      small_cache phi_cache;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   553
489c9b5090e2 Initial load
duke
parents:
diff changeset
   554
      // Inspect all Phi uses to make the Phi go dead
489c9b5090e2 Initial load
duke
parents:
diff changeset
   555
      for (DUIterator_Last lmin, l = phi->last_outs(lmin); l >= lmin; --l) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   556
        Node* use = phi->last_out(l);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   557
        // Compute the new DEF for this USE.  New DEF depends on the path
489c9b5090e2 Initial load
duke
parents:
diff changeset
   558
        // taken from the original DEF to the USE.  The new DEF may be some
489c9b5090e2 Initial load
duke
parents:
diff changeset
   559
        // collection of PHI's merging values from different paths.  The Phis
489c9b5090e2 Initial load
duke
parents:
diff changeset
   560
        // inserted depend only on the location of the USE.  We use a
489c9b5090e2 Initial load
duke
parents:
diff changeset
   561
        // 2-element cache to handle multiple uses from the same block.
10502
17598114b94c 6591247: C2 cleans up the merge point too early during SplitIf
iveresov
parents: 9101
diff changeset
   562
        handle_use(use, phi, &phi_cache, region_dom, new_false, new_true, old_false, old_true);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   563
      } // End of while phi has uses
489c9b5090e2 Initial load
duke
parents:
diff changeset
   564
      // Remove the dead Phi
489c9b5090e2 Initial load
duke
parents:
diff changeset
   565
      _igvn.remove_dead_node( phi );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   566
    } else {
10502
17598114b94c 6591247: C2 cleans up the merge point too early during SplitIf
iveresov
parents: 9101
diff changeset
   567
      assert(phi->in(0) == region, "Inconsistent graph");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   568
      // Random memory op guarded by Region.  Compute new DEF for USE.
10502
17598114b94c 6591247: C2 cleans up the merge point too early during SplitIf
iveresov
parents: 9101
diff changeset
   569
      handle_use(phi, region, &region_cache, region_dom, new_false, new_true, old_false, old_true);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   570
    }
10502
17598114b94c 6591247: C2 cleans up the merge point too early during SplitIf
iveresov
parents: 9101
diff changeset
   571
    // Every path above deletes a use of the region, except for the region
17598114b94c 6591247: C2 cleans up the merge point too early during SplitIf
iveresov
parents: 9101
diff changeset
   572
    // self-cycle (which is needed by handle_use calling find_use_block
17598114b94c 6591247: C2 cleans up the merge point too early during SplitIf
iveresov
parents: 9101
diff changeset
   573
    // calling get_ctrl calling get_ctrl_no_update looking for dead
17598114b94c 6591247: C2 cleans up the merge point too early during SplitIf
iveresov
parents: 9101
diff changeset
   574
    // regions).  So roll back the DUIterator innards.
17598114b94c 6591247: C2 cleans up the merge point too early during SplitIf
iveresov
parents: 9101
diff changeset
   575
    --k;
17598114b94c 6591247: C2 cleans up the merge point too early during SplitIf
iveresov
parents: 9101
diff changeset
   576
  } // End of while merge point has phis
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   577
54027
a37939761ff6 8219448: split-if update_uses accesses stale idom data
neliasso
parents: 49026
diff changeset
   578
  _igvn.remove_dead_node(region);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   579
489c9b5090e2 Initial load
duke
parents:
diff changeset
   580
#ifndef PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   581
  if( VerifyLoopOptimizations ) verify();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   582
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   583
}