comparison src/share/vm/opto/loopTransform.cpp @ 18041:52b4284cb496

Merge with jdk8u20-b26
author Gilles Duboscq <duboscq@ssw.jku.at>
date Wed, 15 Oct 2014 16:02:50 +0200
parents 89152779163c cd3c534f8f4a
children 7848fc12602b
comparison
equal deleted inserted replaced
17606:45d7b2c7029d 18041:52b4284cb496
615 case Op_StrIndexOf: 615 case Op_StrIndexOf:
616 case Op_EncodeISOArray: 616 case Op_EncodeISOArray:
617 case Op_AryEq: { 617 case Op_AryEq: {
618 return false; 618 return false;
619 } 619 }
620 #if INCLUDE_RTM_OPT
621 case Op_FastLock:
622 case Op_FastUnlock: {
623 // Don't unroll RTM locking code because it is large.
624 if (UseRTMLocking) {
625 return false;
626 }
627 }
628 #endif
620 } // switch 629 } // switch
621 } 630 }
622 631
623 return true; // Do maximally unroll 632 return true; // Do maximally unroll
624 } 633 }
711 switch (n->Opcode()) { 720 switch (n->Opcode()) {
712 case Op_XorI: xors_in_loop++; break; // CRC32 java code 721 case Op_XorI: xors_in_loop++; break; // CRC32 java code
713 case Op_ModL: body_size += 30; break; 722 case Op_ModL: body_size += 30; break;
714 case Op_DivL: body_size += 30; break; 723 case Op_DivL: body_size += 30; break;
715 case Op_MulL: body_size += 10; break; 724 case Op_MulL: body_size += 10; break;
716 case Op_FlagsProj:
717 // Can't handle unrolling of loops containing
718 // nodes that generate a FlagsProj at the moment
719 return false;
720 case Op_StrComp: 725 case Op_StrComp:
721 case Op_StrEquals: 726 case Op_StrEquals:
722 case Op_StrIndexOf: 727 case Op_StrIndexOf:
723 case Op_EncodeISOArray: 728 case Op_EncodeISOArray:
724 case Op_AryEq: { 729 case Op_AryEq: {
725 // Do not unroll a loop with String intrinsics code. 730 // Do not unroll a loop with String intrinsics code.
726 // String intrinsics are large and have loops. 731 // String intrinsics are large and have loops.
727 return false; 732 return false;
728 } 733 }
734 #if INCLUDE_RTM_OPT
735 case Op_FastLock:
736 case Op_FastUnlock: {
737 // Don't unroll RTM locking code because it is large.
738 if (UseRTMLocking) {
739 return false;
740 }
741 }
742 #endif
729 } // switch 743 } // switch
730 } 744 }
731 745
732 // Check for being too big 746 // Check for being too big
733 if (body_size > (uint)LoopUnrollLimit) { 747 if (body_size > (uint)LoopUnrollLimit) {
778 } 792 }
779 if (bol->as_Bool()->_test._test == BoolTest::ne) 793 if (bol->as_Bool()->_test._test == BoolTest::ne)
780 continue; // not RC 794 continue; // not RC
781 795
782 Node *cmp = bol->in(1); 796 Node *cmp = bol->in(1);
783 if (cmp->is_FlagsProj()) {
784 continue;
785 }
786
787 Node *rc_exp = cmp->in(1); 797 Node *rc_exp = cmp->in(1);
788 Node *limit = cmp->in(2); 798 Node *limit = cmp->in(2);
789 799
790 Node *limit_c = phase->get_ctrl(limit); 800 Node *limit_c = phase->get_ctrl(limit);
791 if( limit_c == phase->C->top() ) 801 if( limit_c == phase->C->top() )
1135 pre_head->set_profile_trip_cnt(4.0); 1145 pre_head->set_profile_trip_cnt(4.0);
1136 1146
1137 // Now force out all loop-invariant dominating tests. The optimizer 1147 // Now force out all loop-invariant dominating tests. The optimizer
1138 // finds some, but we _know_ they are all useless. 1148 // finds some, but we _know_ they are all useless.
1139 peeled_dom_test_elim(loop,old_new); 1149 peeled_dom_test_elim(loop,old_new);
1150 loop->record_for_igvn();
1140 } 1151 }
1141 1152
1142 //------------------------------is_invariant----------------------------- 1153 //------------------------------is_invariant-----------------------------
1143 // Return true if n is invariant 1154 // Return true if n is invariant
1144 bool IdealLoopTree::is_invariant(Node* n) const { 1155 bool IdealLoopTree::is_invariant(Node* n) const {
2697 } else if (t == T_DOUBLE) { 2708 } else if (t == T_DOUBLE) {
2698 store_value = new (C) MoveD2LNode(store_value); 2709 store_value = new (C) MoveD2LNode(store_value);
2699 _igvn.register_new_node_with_optimizer(store_value); 2710 _igvn.register_new_node_with_optimizer(store_value);
2700 } 2711 }
2701 2712
2713 if (CCallingConventionRequiresIntsAsLongs &&
2714 // See StubRoutines::select_fill_function for types. FLOAT has been converted to INT.
2715 (t == T_FLOAT || t == T_INT || is_subword_type(t))) {
2716 store_value = new (C) ConvI2LNode(store_value);
2717 _igvn.register_new_node_with_optimizer(store_value);
2718 }
2719
2702 Node* mem_phi = store->in(MemNode::Memory); 2720 Node* mem_phi = store->in(MemNode::Memory);
2703 Node* result_ctrl; 2721 Node* result_ctrl;
2704 Node* result_mem; 2722 Node* result_mem;
2705 const TypeFunc* call_type = OptoRuntime::array_fill_Type(); 2723 const TypeFunc* call_type = OptoRuntime::array_fill_Type();
2706 CallLeafNode *call = new (C) CallLeafNoFPNode(call_type, fill, 2724 CallLeafNode *call = new (C) CallLeafNoFPNode(call_type, fill,
2707 fill_name, TypeAryPtr::get_array_body_type(t)); 2725 fill_name, TypeAryPtr::get_array_body_type(t));
2708 call->init_req(TypeFunc::Parms+0, from); 2726 uint cnt = 0;
2709 call->init_req(TypeFunc::Parms+1, store_value); 2727 call->init_req(TypeFunc::Parms + cnt++, from);
2728 call->init_req(TypeFunc::Parms + cnt++, store_value);
2729 if (CCallingConventionRequiresIntsAsLongs) {
2730 call->init_req(TypeFunc::Parms + cnt++, C->top());
2731 }
2710 #ifdef _LP64 2732 #ifdef _LP64
2711 len = new (C) ConvI2LNode(len); 2733 len = new (C) ConvI2LNode(len);
2712 _igvn.register_new_node_with_optimizer(len); 2734 _igvn.register_new_node_with_optimizer(len);
2713 #endif 2735 #endif
2714 call->init_req(TypeFunc::Parms+2, len); 2736 call->init_req(TypeFunc::Parms + cnt++, len);
2715 #ifdef _LP64 2737 #ifdef _LP64
2716 call->init_req(TypeFunc::Parms+3, C->top()); 2738 call->init_req(TypeFunc::Parms + cnt++, C->top());
2717 #endif 2739 #endif
2718 call->init_req( TypeFunc::Control, head->init_control()); 2740 call->init_req(TypeFunc::Control, head->init_control());
2719 call->init_req( TypeFunc::I_O , C->top() ) ; // does no i/o 2741 call->init_req(TypeFunc::I_O, C->top()); // Does no I/O.
2720 call->init_req( TypeFunc::Memory , mem_phi->in(LoopNode::EntryControl) ); 2742 call->init_req(TypeFunc::Memory, mem_phi->in(LoopNode::EntryControl));
2721 call->init_req( TypeFunc::ReturnAdr, C->start()->proj_out(TypeFunc::ReturnAdr) ); 2743 call->init_req(TypeFunc::ReturnAdr, C->start()->proj_out(TypeFunc::ReturnAdr));
2722 call->init_req( TypeFunc::FramePtr, C->start()->proj_out(TypeFunc::FramePtr) ); 2744 call->init_req(TypeFunc::FramePtr, C->start()->proj_out(TypeFunc::FramePtr));
2723 _igvn.register_new_node_with_optimizer(call); 2745 _igvn.register_new_node_with_optimizer(call);
2724 result_ctrl = new (C) ProjNode(call,TypeFunc::Control); 2746 result_ctrl = new (C) ProjNode(call,TypeFunc::Control);
2725 _igvn.register_new_node_with_optimizer(result_ctrl); 2747 _igvn.register_new_node_with_optimizer(result_ctrl);
2726 result_mem = new (C) ProjNode(call,TypeFunc::Memory); 2748 result_mem = new (C) ProjNode(call,TypeFunc::Memory);
2727 _igvn.register_new_node_with_optimizer(result_mem); 2749 _igvn.register_new_node_with_optimizer(result_mem);