[llvm] [X86] remove unnecessary movs when %rdx is an input to mulx (PR #184462)

Phoebe Wang via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 5 23:02:58 PST 2026


phoebewang wrote:

> > I was thinking we'd better do it in a general way. But took a look at instructions, seems MULX is the only one that can commute operands with implicit register. So LGTM.
> 
> Doesn't the MUL/IMUL that produces a full product have the same issue? It multiplies AL/AX/EAX/RAX by another register or memory.

The 2addr pass handles it: https://godbolt.org/z/acrs67ffG. MULX is not a tranditional 2addr instruction.

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


More information about the llvm-commits mailing list