RFR: 8288445: AArch64: C2 compilation fails with guarantee(!true || (true && (shift != 0))) failed: impossible encoding [v3]

Hao Sun haosun at openjdk.org
Thu Jun 23 03:38:41 UTC 2022


On Thu, 23 Jun 2022 03:24:56 GMT, Dean Long <dlong at openjdk.org> wrote:

>> test/hotspot/jtreg/compiler/codegen/ShiftByZero.java line 42:
>> 
>>> 40:     public static void bMeth() {
>>> 41:         int shift = i32[0];
>>> 42:         for (int i8 = 279; i8 > 1; --i8) {
>> 
>> Why one loop is used here? I thought low 6 bits of shift can turn to be zeros in one single iteration. Is there anything I missed? Thanks.
>
> This is to confuse the optimizer, so that "shift" is optimized to 0 only after loop vectorization.  Otherwise, the back-end may never see such a value.

I see. Thanks.

-------------

PR: https://git.openjdk.org/jdk19/pull/40


More information about the hotspot-compiler-dev mailing list