src/share/vm/opto/superword.cpp

changeset 10015
eb7ce841ccec
parent 9806
758c07667682
parent 9977
e649f2136368
     1.1 --- a/src/share/vm/opto/superword.cpp	Sat Oct 24 16:18:50 2020 +0800
     1.2 +++ b/src/share/vm/opto/superword.cpp	Sat Oct 24 16:43:47 2020 +0800
     1.3 @@ -2209,21 +2209,13 @@
     1.4  //----------------------------get_pre_loop_end---------------------------
     1.5  // Find pre loop end from main loop.  Returns null if none.
     1.6  CountedLoopEndNode* SuperWord::get_pre_loop_end(CountedLoopNode* cl) {
     1.7 -  Node* ctrl = cl->in(LoopNode::EntryControl);
     1.8 -  if (!ctrl->is_IfTrue() && !ctrl->is_IfFalse()) return NULL;
     1.9 -  Node* iffm = ctrl->in(0);
    1.10 -  if (!iffm->is_If()) return NULL;
    1.11 -  Node* bolzm = iffm->in(1);
    1.12 -  if (!bolzm->is_Bool()) return NULL;
    1.13 -  Node* cmpzm = bolzm->in(1);
    1.14 -  if (!cmpzm->is_Cmp()) return NULL;
    1.15 -  Node* opqzm = cmpzm->in(2);
    1.16 -  // Can not optimize a loop if zero-trip Opaque1 node is optimized
    1.17 -  // away and then another round of loop opts attempted.
    1.18 -  if (opqzm->Opcode() != Op_Opaque1) {
    1.19 +  // The loop cannot be optimized if the graph shape at
    1.20 +  // the loop entry is inappropriate.
    1.21 +  if (!PhaseIdealLoop::is_canonical_main_loop_entry(cl)) {
    1.22      return NULL;
    1.23    }
    1.24 -  Node* p_f = iffm->in(0);
    1.25 +
    1.26 +  Node* p_f = cl->in(LoopNode::EntryControl)->in(0)->in(0);
    1.27    if (!p_f->is_IfFalse()) return NULL;
    1.28    if (!p_f->in(0)->is_CountedLoopEnd()) return NULL;
    1.29    CountedLoopEndNode* pre_end = p_f->in(0)->as_CountedLoopEnd();

mercurial