[llvm] [X86] ICMP EQ/NE MIN_SIGNED_INT - avoid immediate argument by using NEG + SETO/SETNO (PR #94948)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 11 02:48:14 PDT 2024


RKSimon wrote:

> > I've let this fold run for i8+i16 as well as i32+i64, despite there being less of a codesize saving.
> > Why? We supports immediate folding in HW, and I believe the immediate does not bring any cost if the codesize is less.

We always save at least 1 byte in the NEG vs CMP-imm encoding, so as long as we don't introduce any extra register moves we're still better off.

Would people prefer if I just limited this to i32/i64 for now?

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


More information about the llvm-commits mailing list