Look through G_TRUNCs, G_SEXTs, and G_ZEXTs when looking for a G_CONSTANT instead of giving up when the first thing we see isn't a G_CONSTANT.
This gives an average ~1.3% code size improvement on CINT2000 at -O3.
Differential D64108
[GlobalISel][AArch64] Use getConstantVRegValWithLookThrough for selectArithImmed paquette on Jul 2 2019, 3:51 PM. Authored by
Details Look through G_TRUNCs, G_SEXTs, and G_ZEXTs when looking for a G_CONSTANT instead of giving up when the first thing we see isn't a G_CONSTANT. This gives an average ~1.3% code size improvement on CINT2000 at -O3.
Diff Detail
Event TimelineComment Actions General direction LGTM but there's a bug in the current patch unless I am mistaken. As a general note, if we need to use this specific helper in more places, I think we should fix the way we handle constant like I already mentioned in https://reviews.llvm.org/D59227.
Comment Actions Use getConstantVRegValWithLookThrough properly and update test to include a weird number which should lose some bits in the G_TRUNC. |