< prev index next >

src/hotspot/share/opto/loopTransform.cpp

Print this page




2835 }
2836 
2837 
2838 //------------------------------adjust_loop_exit_prob--------------------------
2839 // Look for loop-exit tests with the 50/50 (or worse) guesses from the parsing stage.
2840 // Replace with a 1-in-10 exit guess.
2841 void IdealLoopTree::adjust_loop_exit_prob( PhaseIdealLoop *phase ) {
2842   Node *test = tail();
2843   while( test != _head ) {
2844     uint top = test->Opcode();
2845     if( top == Op_IfTrue || top == Op_IfFalse ) {
2846       int test_con = ((ProjNode*)test)->_con;
2847       assert(top == (uint)(test_con? Op_IfTrue: Op_IfFalse), "sanity");
2848       IfNode *iff = test->in(0)->as_If();
2849       if( iff->outcnt() == 2 ) {        // Ignore dead tests
2850         Node *bol = iff->in(1);
2851         if( bol && bol->req() > 1 && bol->in(1) &&
2852             ((bol->in(1)->Opcode() == Op_StorePConditional ) ||
2853              (bol->in(1)->Opcode() == Op_StoreIConditional ) ||
2854              (bol->in(1)->Opcode() == Op_StoreLConditional ) ||








2855              (bol->in(1)->Opcode() == Op_CompareAndExchangeB ) ||
2856              (bol->in(1)->Opcode() == Op_CompareAndExchangeS ) ||
2857              (bol->in(1)->Opcode() == Op_CompareAndExchangeI ) ||
2858              (bol->in(1)->Opcode() == Op_CompareAndExchangeL ) ||
2859              (bol->in(1)->Opcode() == Op_CompareAndExchangeP ) ||
2860              (bol->in(1)->Opcode() == Op_CompareAndExchangeN ) ||
2861              (bol->in(1)->Opcode() == Op_WeakCompareAndSwapB ) ||
2862              (bol->in(1)->Opcode() == Op_WeakCompareAndSwapS ) ||
2863              (bol->in(1)->Opcode() == Op_WeakCompareAndSwapI ) ||
2864              (bol->in(1)->Opcode() == Op_WeakCompareAndSwapL ) ||
2865              (bol->in(1)->Opcode() == Op_WeakCompareAndSwapP ) ||
2866              (bol->in(1)->Opcode() == Op_WeakCompareAndSwapN ) ||
2867              (bol->in(1)->Opcode() == Op_CompareAndSwapB ) ||
2868              (bol->in(1)->Opcode() == Op_CompareAndSwapS ) ||
2869              (bol->in(1)->Opcode() == Op_CompareAndSwapI ) ||
2870              (bol->in(1)->Opcode() == Op_CompareAndSwapL ) ||
2871              (bol->in(1)->Opcode() == Op_CompareAndSwapP ) ||
2872              (bol->in(1)->Opcode() == Op_CompareAndSwapN )))
2873           return;               // Allocation loops RARELY take backedge
2874         // Find the OTHER exit path from the IF




2835 }
2836 
2837 
2838 //------------------------------adjust_loop_exit_prob--------------------------
2839 // Look for loop-exit tests with the 50/50 (or worse) guesses from the parsing stage.
2840 // Replace with a 1-in-10 exit guess.
2841 void IdealLoopTree::adjust_loop_exit_prob( PhaseIdealLoop *phase ) {
2842   Node *test = tail();
2843   while( test != _head ) {
2844     uint top = test->Opcode();
2845     if( top == Op_IfTrue || top == Op_IfFalse ) {
2846       int test_con = ((ProjNode*)test)->_con;
2847       assert(top == (uint)(test_con? Op_IfTrue: Op_IfFalse), "sanity");
2848       IfNode *iff = test->in(0)->as_If();
2849       if( iff->outcnt() == 2 ) {        // Ignore dead tests
2850         Node *bol = iff->in(1);
2851         if( bol && bol->req() > 1 && bol->in(1) &&
2852             ((bol->in(1)->Opcode() == Op_StorePConditional ) ||
2853              (bol->in(1)->Opcode() == Op_StoreIConditional ) ||
2854              (bol->in(1)->Opcode() == Op_StoreLConditional ) ||
2855 #if INCLUDE_SHENANDOAHGC
2856              (bol->in(1)->Opcode() == Op_ShenandoahCompareAndExchangeP ) ||
2857              (bol->in(1)->Opcode() == Op_ShenandoahCompareAndExchangeN ) ||
2858              (bol->in(1)->Opcode() == Op_ShenandoahWeakCompareAndSwapP ) ||
2859              (bol->in(1)->Opcode() == Op_ShenandoahWeakCompareAndSwapN ) ||
2860              (bol->in(1)->Opcode() == Op_ShenandoahCompareAndSwapP ) ||
2861              (bol->in(1)->Opcode() == Op_ShenandoahCompareAndSwapN ) ||
2862 #endif
2863              (bol->in(1)->Opcode() == Op_CompareAndExchangeB ) ||
2864              (bol->in(1)->Opcode() == Op_CompareAndExchangeS ) ||
2865              (bol->in(1)->Opcode() == Op_CompareAndExchangeI ) ||
2866              (bol->in(1)->Opcode() == Op_CompareAndExchangeL ) ||
2867              (bol->in(1)->Opcode() == Op_CompareAndExchangeP ) ||
2868              (bol->in(1)->Opcode() == Op_CompareAndExchangeN ) ||
2869              (bol->in(1)->Opcode() == Op_WeakCompareAndSwapB ) ||
2870              (bol->in(1)->Opcode() == Op_WeakCompareAndSwapS ) ||
2871              (bol->in(1)->Opcode() == Op_WeakCompareAndSwapI ) ||
2872              (bol->in(1)->Opcode() == Op_WeakCompareAndSwapL ) ||
2873              (bol->in(1)->Opcode() == Op_WeakCompareAndSwapP ) ||
2874              (bol->in(1)->Opcode() == Op_WeakCompareAndSwapN ) ||
2875              (bol->in(1)->Opcode() == Op_CompareAndSwapB ) ||
2876              (bol->in(1)->Opcode() == Op_CompareAndSwapS ) ||
2877              (bol->in(1)->Opcode() == Op_CompareAndSwapI ) ||
2878              (bol->in(1)->Opcode() == Op_CompareAndSwapL ) ||
2879              (bol->in(1)->Opcode() == Op_CompareAndSwapP ) ||
2880              (bol->in(1)->Opcode() == Op_CompareAndSwapN )))
2881           return;               // Allocation loops RARELY take backedge
2882         // Find the OTHER exit path from the IF


< prev index next >