aboutsummaryrefslogtreecommitdiff
path: root/src/share/vm/opto/loopopts.cpp
diff options
context:
space:
mode:
authorkvn <none@none>2008-02-29 19:07:15 -0800
committerkvn <none@none>2008-02-29 19:07:15 -0800
commitc4fdf46c69a0b01b4fe2469f30be30104b5c6ddf (patch)
tree70e955134854d540092b644f49ad1aa9f36161a5 /src/share/vm/opto/loopopts.cpp
parent90160e76d000a5afbe6a4af57880cdf3644f1ddb (diff)
6667588: Don't generate duplicated CMP for float/double values
Summary: float CMove generation add duplicated CMPF if there are more then one Move depending on the condition. Reviewed-by: jrose, never, rasbold
Diffstat (limited to 'src/share/vm/opto/loopopts.cpp')
-rw-r--r--src/share/vm/opto/loopopts.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/share/vm/opto/loopopts.cpp b/src/share/vm/opto/loopopts.cpp
index 0da6b1eee..d7b9ec893 100644
--- a/src/share/vm/opto/loopopts.cpp
+++ b/src/share/vm/opto/loopopts.cpp
@@ -435,9 +435,11 @@ Node *PhaseIdealLoop::conditional_move( Node *region ) {
// Check profitability
int cost = 0;
+ int phis = 0;
for (DUIterator_Fast imax, i = region->fast_outs(imax); i < imax; i++) {
Node *out = region->fast_out(i);
if( !out->is_Phi() ) continue; // Ignore other control edges, etc
+ phis++;
PhiNode* phi = out->as_Phi();
switch (phi->type()->basic_type()) {
case T_LONG:
@@ -489,6 +491,12 @@ Node *PhaseIdealLoop::conditional_move( Node *region ) {
}
}
if( cost >= ConditionalMoveLimit ) return NULL; // Too much goo
+ Node* bol = iff->in(1);
+ assert( bol->Opcode() == Op_Bool, "" );
+ int cmp_op = bol->in(1)->Opcode();
+ // It is expensive to generate flags from a float compare.
+ // Avoid duplicated float compare.
+ if( phis > 1 && (cmp_op == Op_CmpF || cmp_op == Op_CmpD)) return NULL;
// --------------
// Now replace all Phis with CMOV's