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

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 28 10:41:39 PDT 2024


topperc 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).
> 

I guess I didn't pay enough attention to notice this is specific to the bit extract code that generates bzhi or bextr. That should really be spelled out in the description. The title makes it sound like a generic optimization

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


More information about the llvm-commits mailing list