Mercurial > hg > truffle
comparison src/share/vm/opto/compile.cpp @ 14495:cd5d10655495
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 | 45467c53f178 |
children | fdad2932c73f |
comparison
equal
deleted
inserted
replaced
14494:5292439ef895 | 14495:cd5d10655495 |
---|---|
3026 // confuses register allocation. | 3026 // confuses register allocation. |
3027 if (n->req() > MemBarNode::Precedent) { | 3027 if (n->req() > MemBarNode::Precedent) { |
3028 n->set_req(MemBarNode::Precedent, top()); | 3028 n->set_req(MemBarNode::Precedent, top()); |
3029 } | 3029 } |
3030 break; | 3030 break; |
3031 // Must set a control edge on all nodes that produce a FlagsProj | |
3032 // so they can't escape the block that consumes the flags. | |
3033 // Must also set the non throwing branch as the control | |
3034 // for all nodes that depends on the result. Unless the node | |
3035 // already have a control that isn't the control of the | |
3036 // flag producer | |
3037 case Op_FlagsProj: | |
3038 { | |
3039 MathExactNode* math = (MathExactNode*) n->in(0); | |
3040 Node* ctrl = math->control_node(); | |
3041 Node* non_throwing = math->non_throwing_branch(); | |
3042 math->set_req(0, ctrl); | |
3043 | |
3044 Node* result = math->result_node(); | |
3045 if (result != NULL) { | |
3046 for (DUIterator_Fast jmax, j = result->fast_outs(jmax); j < jmax; j++) { | |
3047 Node* out = result->fast_out(j); | |
3048 // Phi nodes shouldn't be moved. They would only match below if they | |
3049 // had the same control as the MathExactNode. The only time that | |
3050 // would happen is if the Phi is also an input to the MathExact | |
3051 // | |
3052 // Cmp nodes shouldn't have control set at all. | |
3053 if (out->is_Phi() || | |
3054 out->is_Cmp()) { | |
3055 continue; | |
3056 } | |
3057 | |
3058 if (out->in(0) == NULL) { | |
3059 out->set_req(0, non_throwing); | |
3060 } else if (out->in(0) == ctrl) { | |
3061 out->set_req(0, non_throwing); | |
3062 } | |
3063 } | |
3064 } | |
3065 } | |
3066 break; | |
3067 default: | 3031 default: |
3068 assert( !n->is_Call(), "" ); | 3032 assert( !n->is_Call(), "" ); |
3069 assert( !n->is_Mem(), "" ); | 3033 assert( !n->is_Mem(), "" ); |
3070 break; | 3034 break; |
3071 } | 3035 } |