Conditional moves vs. branching in unrolled loops
Paul Sandoz
paul.sandoz at oracle.com
Wed Jan 6 14:14:40 UTC 2016
> On 6 Jan 2016, at 11:12, Paul Sandoz <Paul.Sandoz at oracle.com> wrote:
> At least for this set of tests the results indicate conditional moves offer no major advantage over branching. For the worst case branching scenario (the “50 cent” case) conditional moves appear marginally better, but as you say the data pattern is likely rare.
Scrap that, cmoves are kicking for "A.forTest_if 0.5 RANDOM_RAMP_UP"
Disabling them with -XX:ConditionalMoveLimit==0 (thanks Roland), muddies the waters a bit:
# VM options: -XX:-TieredCompilation
Benchmark (bias) (dg) (size) Mode Cnt Score Error Units
A.forTest_if 0.1 RANDOM_RAMP_UP 1 avgt 5 3.535 ± 0.083 ns/op
A.forTest_if 0.1 RANDOM_RAMP_UP 10 avgt 5 7.478 ± 0.232 ns/op
A.forTest_if 0.1 RANDOM_RAMP_UP 100 avgt 5 42.348 ± 0.922 ns/op
A.forTest_if 0.1 RANDOM_RAMP_UP 1000 avgt 5 460.924 ± 12.692 ns/op
A.forTest_if 0.1 RANDOM_RAMP_UP 10000 avgt 5 3708.576 ± 110.138 ns/op
A.forTest_if 0.5 RANDOM_RAMP_UP 1 avgt 5 3.557 ± 0.172 ns/op
A.forTest_if 0.5 RANDOM_RAMP_UP 10 avgt 5 9.860 ± 0.135 ns/op
A.forTest_if 0.5 RANDOM_RAMP_UP 100 avgt 5 82.380 ± 1.971 ns/op
A.forTest_if 0.5 RANDOM_RAMP_UP 1000 avgt 5 832.391 ± 23.629 ns/op
A.forTest_if 0.5 RANDOM_RAMP_UP 10000 avgt 5 8325.406 ± 206.872 ns/op
# VM options: -XX:ConditionalMoveLimit=0 -XX:-TieredCompilation
Benchmark (bias) (dg) (size) Mode Cnt Score Error Units
A.forTest_if 0.1 RANDOM_RAMP_UP 1 avgt 5 3.554 ± 0.049 ns/op
A.forTest_if 0.1 RANDOM_RAMP_UP 10 avgt 5 9.382 ± 0.062 ns/op
A.forTest_if 0.1 RANDOM_RAMP_UP 100 avgt 5 37.483 ± 0.696 ns/op
A.forTest_if 0.1 RANDOM_RAMP_UP 1000 avgt 5 369.375 ± 9.780 ns/op
A.forTest_if 0.1 RANDOM_RAMP_UP 10000 avgt 5 3712.492 ± 128.310 ns/op
A.forTest_if 0.5 RANDOM_RAMP_UP 1 avgt 5 3.546 ± 0.053 ns/op
A.forTest_if 0.5 RANDOM_RAMP_UP 10 avgt 5 7.488 ± 0.118 ns/op
A.forTest_if 0.5 RANDOM_RAMP_UP 100 avgt 5 52.889 ± 5.328 ns/op
A.forTest_if 0.5 RANDOM_RAMP_UP 1000 avgt 5 447.437 ± 14.273 ns/op
A.forTest_if 0.5 RANDOM_RAMP_UP 10000 avgt 5 10040.920 ± 993.644 ns/op
Paul.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20160106/44971ea9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20160106/44971ea9/signature.asc>
More information about the hotspot-compiler-dev
mailing list