src/share/vm/opto/loopTransform.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/opto

src/share/vm/opto/loopTransform.cpp

Print this page
rev 8544 : 8078866: compiler/eliminateAutobox/6934604/TestIntBoxing.java assert(p_f->Opcode() == Op_IfFalse) failed
Summary: Bail out from range check elimination if pre loop is not found
Reviewed-by:


1897 
1898   // Need to find the main-loop zero-trip guard
1899   Node *ctrl  = cl->in(LoopNode::EntryControl);
1900   assert(ctrl->Opcode() == Op_IfTrue || ctrl->Opcode() == Op_IfFalse, "");
1901   Node *iffm = ctrl->in(0);
1902   assert(iffm->Opcode() == Op_If, "");
1903   Node *bolzm = iffm->in(1);
1904   assert(bolzm->Opcode() == Op_Bool, "");
1905   Node *cmpzm = bolzm->in(1);
1906   assert(cmpzm->is_Cmp(), "");
1907   Node *opqzm = cmpzm->in(2);
1908   // Can not optimize a loop if zero-trip Opaque1 node is optimized
1909   // away and then another round of loop opts attempted.
1910   if (opqzm->Opcode() != Op_Opaque1)
1911     return;
1912   assert(opqzm->in(1) == main_limit, "do not understand situation");
1913 
1914   // Find the pre-loop limit; we will expand it's iterations to
1915   // not ever trip low tests.
1916   Node *p_f = iffm->in(0);
1917   assert(p_f->Opcode() == Op_IfFalse, "");



1918   CountedLoopEndNode *pre_end = p_f->in(0)->as_CountedLoopEnd();
1919   assert(pre_end->loopnode()->is_pre_loop(), "");
1920   Node *pre_opaq1 = pre_end->limit();
1921   // Occasionally it's possible for a pre-loop Opaque1 node to be
1922   // optimized away and then another round of loop opts attempted.
1923   // We can not optimize this particular loop in that case.
1924   if (pre_opaq1->Opcode() != Op_Opaque1)
1925     return;
1926   Opaque1Node *pre_opaq = (Opaque1Node*)pre_opaq1;
1927   Node *pre_limit = pre_opaq->in(1);
1928 
1929   // Where do we put new limit calculations
1930   Node *pre_ctrl = pre_end->loopnode()->in(LoopNode::EntryControl);
1931 
1932   // Ensure the original loop limit is available from the
1933   // pre-loop Opaque1 node.
1934   Node *orig_limit = pre_opaq->original_loop_limit();
1935   if (orig_limit == NULL || _igvn.type(orig_limit) == Type::TOP)
1936     return;
1937 




1897 
1898   // Need to find the main-loop zero-trip guard
1899   Node *ctrl  = cl->in(LoopNode::EntryControl);
1900   assert(ctrl->Opcode() == Op_IfTrue || ctrl->Opcode() == Op_IfFalse, "");
1901   Node *iffm = ctrl->in(0);
1902   assert(iffm->Opcode() == Op_If, "");
1903   Node *bolzm = iffm->in(1);
1904   assert(bolzm->Opcode() == Op_Bool, "");
1905   Node *cmpzm = bolzm->in(1);
1906   assert(cmpzm->is_Cmp(), "");
1907   Node *opqzm = cmpzm->in(2);
1908   // Can not optimize a loop if zero-trip Opaque1 node is optimized
1909   // away and then another round of loop opts attempted.
1910   if (opqzm->Opcode() != Op_Opaque1)
1911     return;
1912   assert(opqzm->in(1) == main_limit, "do not understand situation");
1913 
1914   // Find the pre-loop limit; we will expand it's iterations to
1915   // not ever trip low tests.
1916   Node *p_f = iffm->in(0);
1917   // pre loop may have been optimized out
1918   if (p_f->Opcode() != Op_IfFalse) {
1919     return;
1920   }
1921   CountedLoopEndNode *pre_end = p_f->in(0)->as_CountedLoopEnd();
1922   assert(pre_end->loopnode()->is_pre_loop(), "");
1923   Node *pre_opaq1 = pre_end->limit();
1924   // Occasionally it's possible for a pre-loop Opaque1 node to be
1925   // optimized away and then another round of loop opts attempted.
1926   // We can not optimize this particular loop in that case.
1927   if (pre_opaq1->Opcode() != Op_Opaque1)
1928     return;
1929   Opaque1Node *pre_opaq = (Opaque1Node*)pre_opaq1;
1930   Node *pre_limit = pre_opaq->in(1);
1931 
1932   // Where do we put new limit calculations
1933   Node *pre_ctrl = pre_end->loopnode()->in(LoopNode::EntryControl);
1934 
1935   // Ensure the original loop limit is available from the
1936   // pre-loop Opaque1 node.
1937   Node *orig_limit = pre_opaq->original_loop_limit();
1938   if (orig_limit == NULL || _igvn.type(orig_limit) == Type::TOP)
1939     return;
1940 


src/share/vm/opto/loopTransform.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File