File tree Expand file tree Collapse file tree 3 files changed +14
-65
lines changed
micro/org/openjdk/bench/vm/compiler Expand file tree Collapse file tree 3 files changed +14
-65
lines changed Original file line number Diff line number Diff line change @@ -795,18 +795,25 @@ Node *PhaseIdealLoop::conditional_move( Node *region ) {
795795 // Avoid duplicated float compare.
796796 if (phis > 1 && (cmp_op == Op_CmpF || cmp_op == Op_CmpD)) return nullptr ;
797797
798- // Ignore cost if CMOVE can be moved outside the loop.
799- if (used_inside_loop && cost >= ConditionalMoveLimit) {
800- return nullptr ;
798+ float infrequent_prob = PROB_UNLIKELY_MAG (3 );
799+ // Ignore cost and blocks frequency if CMOVE can be moved outside the loop.
800+ if (used_inside_loop) {
801+ if (cost >= ConditionalMoveLimit) return nullptr ; // Too much goo
802+
803+ // BlockLayoutByFrequency optimization moves infrequent branch
804+ // from hot path. No point in CMOV'ing in such case (110 is used
805+ // instead of 100 to take into account not exactness of float value).
806+ if (BlockLayoutByFrequency) {
807+ infrequent_prob = MAX2 (infrequent_prob, (float )BlockLayoutMinDiamondPercentage/110 .0f );
808+ }
801809 }
802810 // Check for highly predictable branch. No point in CMOV'ing if
803811 // we are going to predict accurately all the time.
804- constexpr float infrequent_prob = PROB_UNLIKELY_MAG (2 );
805812 if (C->use_cmove () && (cmp_op == Op_CmpF || cmp_op == Op_CmpD)) {
806813 // keep going
807- } else if (iff->_prob < infrequent_prob || iff->_prob > (1 .0f - infrequent_prob)) {
814+ } else if (iff->_prob < infrequent_prob ||
815+ iff->_prob > (1 .0f - infrequent_prob))
808816 return nullptr ;
809- }
810817
811818 // --------------
812819 // Now replace all Phis with CMOV's
Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ compiler/c2/Test8004741.java 8235801 generic-all
6767compiler/c2/TestMergeStores.java#id0 8331311 generic-ppc64,linux-s390x
6868compiler/c2/TestMergeStores.java#id1 8331311 generic-ppc64,linux-s390x
6969compiler/c2/irTests/TestDuplicateBackedge.java 8318904 generic-all
70+ compiler/c2/irTests/TestIfMinMax.java 8334816 generic-all
7071
7172compiler/codecache/jmx/PoolsIndependenceTest.java 8264632 macosx-all
7273compiler/codecache/CheckLargePages.java 8332654 linux-x64
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments