--- a/src/hotspot/share/opto/loopopts.cpp Tue Dec 05 21:26:11 2017 +0530
+++ b/src/hotspot/share/opto/loopopts.cpp Tue Dec 05 09:49:23 2017 -0800
@@ -528,13 +528,12 @@
BasicType bt = phi->type()->basic_type();
switch (bt) {
case T_DOUBLE:
+ case T_FLOAT:
if (C->use_cmove()) {
continue; //TODO: maybe we want to add some cost
}
- case T_FLOAT: {
cost += Matcher::float_cmove_cost(); // Could be very expensive
break;
- }
case T_LONG: {
cost += Matcher::long_cmove_cost(); // May encodes as 2 CMOV's
}
@@ -613,8 +612,9 @@
}
// Check for highly predictable branch. No point in CMOV'ing if
// we are going to predict accurately all the time.
- if (C->use_cmove() && cmp_op == Op_CmpD) ;//keep going
- else if (iff->_prob < infrequent_prob ||
+ if (C->use_cmove() && (cmp_op == Op_CmpF || cmp_op == Op_CmpD)) {
+ //keep going
+ } else if (iff->_prob < infrequent_prob ||
iff->_prob > (1.0f - infrequent_prob))
return NULL;