C2: Did something just happen to unrolling?

Andrew Haley aph-open at littlepinkcloud.com
Tue May 10 11:59:57 UTC 2022


On 4/27/22 06:01, Tobias Hartmann wrote:
> Andrew, do you have a reproducer so we can file a bug?

Just for the record: the problem was caused code in loopTransform.cpp
that went in as part of 8279508: Auto-vectorize Math.round API.

I was auto-vectorizing Math.round, but nothing was working. My problem
was that the code in 8279508 to IdealLoopTree::policy_unroll assigns
a very heavy weight to all of the Op_Round operations, so they don't
much unroll. This is ok for x86 avx512 but probably not for anything
else.

It isn't appropriate for the weighting to be in shared code, so I
moved it to cpu-specific code as part of the commit for 8282541,
AArch64: Auto-vectorize Math.round API
https://github.com/openjdk/jdk/commit/a7b5157375f3691a7425f15a78cd5411776b9331

Incidentally, policy_unroll also gives a heavy weight for Op_ModL, DivL, MulL.
I think that's a hangover from x86-32, and now we have 64-bit division
instructions perhaps it can be usefully removed.

-- 
Andrew Haley  (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671


More information about the hotspot-compiler-dev mailing list