Mercurial > hg > truffle
comparison src/share/vm/opto/compile.cpp @ 17726:085b304a1cc5
8027754: Enable loop optimizations for loops with MathExact inside
Reviewed-by: kvn, iveresov
author | rbackman |
---|---|
date | Thu, 23 Jan 2014 12:08:28 +0100 |
parents | 1419657ed891 |
children | b8413a9cbb84 |
comparison
equal
deleted
inserted
replaced
17725:b4ce4e9eb97d | 17726:085b304a1cc5 |
---|---|
3010 // confuses register allocation. | 3010 // confuses register allocation. |
3011 if (n->req() > MemBarNode::Precedent) { | 3011 if (n->req() > MemBarNode::Precedent) { |
3012 n->set_req(MemBarNode::Precedent, top()); | 3012 n->set_req(MemBarNode::Precedent, top()); |
3013 } | 3013 } |
3014 break; | 3014 break; |
3015 // Must set a control edge on all nodes that produce a FlagsProj | |
3016 // so they can't escape the block that consumes the flags. | |
3017 // Must also set the non throwing branch as the control | |
3018 // for all nodes that depends on the result. Unless the node | |
3019 // already have a control that isn't the control of the | |
3020 // flag producer | |
3021 case Op_FlagsProj: | |
3022 { | |
3023 MathExactNode* math = (MathExactNode*) n->in(0); | |
3024 Node* ctrl = math->control_node(); | |
3025 Node* non_throwing = math->non_throwing_branch(); | |
3026 math->set_req(0, ctrl); | |
3027 | |
3028 Node* result = math->result_node(); | |
3029 if (result != NULL) { | |
3030 for (DUIterator_Fast jmax, j = result->fast_outs(jmax); j < jmax; j++) { | |
3031 Node* out = result->fast_out(j); | |
3032 // Phi nodes shouldn't be moved. They would only match below if they | |
3033 // had the same control as the MathExactNode. The only time that | |
3034 // would happen is if the Phi is also an input to the MathExact | |
3035 // | |
3036 // Cmp nodes shouldn't have control set at all. | |
3037 if (out->is_Phi() || | |
3038 out->is_Cmp()) { | |
3039 continue; | |
3040 } | |
3041 | |
3042 if (out->in(0) == NULL) { | |
3043 out->set_req(0, non_throwing); | |
3044 } else if (out->in(0) == ctrl) { | |
3045 out->set_req(0, non_throwing); | |
3046 } | |
3047 } | |
3048 } | |
3049 } | |
3050 break; | |
3051 default: | 3015 default: |
3052 assert( !n->is_Call(), "" ); | 3016 assert( !n->is_Call(), "" ); |
3053 assert( !n->is_Mem(), "" ); | 3017 assert( !n->is_Mem(), "" ); |
3054 break; | 3018 break; |
3055 } | 3019 } |