[llvm] [X86] Prefer andl to andb to save one byte encoding (PR #86921)

Phoebe Wang via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 28 07:13:58 PDT 2024


phoebewang wrote:

> If it's all around win (i.e. it's at least as fast as andb in all cases and just takes less bytes to encode), then I don't see why it has to be part of matchBitExtract, and can't be own dag combine/transform that does `// Turn (i32)(x & imm8) into (i32)x & imm32.` I think there are already some combines like that, so I'm not sure why they haven't triggered for this case.

I checked them from uops.info, they have identical TP/Lat. I think the reason is matchBitExtract happens during instruction selection, there's no more dag combine for it.

https://github.com/llvm/llvm-project/pull/86921


More information about the llvm-commits mailing list