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

via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 28 10:36:54 PDT 2024


goldsteinn wrote:

> Doesn't this cause an H register merge for eax/ebx/ecx/edx if ah/bh/ch/dh have been written previously?
> 

Would be either way no? In either test case at least there is a 32-bit instruction. IIRC once the H register is
dirty there is always a merging uop to use the 32/64 bit register (or any part for that matter).

> Is the 1 byte savings from the REX prefix needed to access the low register of sil/dil/bph/sph? They look to be same length for other registers.
> 
> If the register is al/eax the andl encoding is larger. https://godbolt.org/z/3xYPnjqas



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


More information about the llvm-commits mailing list