[15] RFR (S): 8242492: C2: Remove Matcher::vector_shift_count_ideal_reg()

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Fri Apr 10 14:25:56 UTC 2020


http://cr.openjdk.java.net/~vlivanov/8242492/webrev.00/
https://bugs.openjdk.java.net/browse/JDK-8242492

Matcher::vector_shift_count_ideal_reg() was introduced specifically for 
x86 to communicate that only low 32 bits are used by vector shift 
instructions, so only those bits should be spilled when needed.

Unfortunately, it is broken for LShiftCntV/RShiftCntV: Matcher doesn't 
capute overridden ideal_reg value and spills use bottom type instead. 
So, it causes a mismatch during RA.

Fortunately, LShiftCntV/RShiftCntV are never spilled on x86. Considering 
how simple AD instructions for LShiftCntV/RShiftCntV are, RA prefers to 
rematerialize the value instead (which is a reg-to-reg move).

I propose to simplify the implementation and completely remove 
Matcher::vector_shift_count_ideal_reg() along with additional special 
handling logic for LShiftCntV/RShiftCntV.

Testing: hs-precheckin-comp, hs-tier1, hs-tier2

Thanks!

Best regards,
Vladimir Ivanov


More information about the hotspot-compiler-dev mailing list