[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:46:08 PDT 2024


================
@@ -783,29 +783,28 @@ define i16 @test_minsigned_i16(i16 %a0, i16 %a1) nounwind {
 define i32 @test_minsigned_i32(i32 %a0, i32 %a1) nounwind {
 ; X64-LABEL: test_minsigned_i32:
 ; X64:       # %bb.0:
-; X64-NEXT:    cmpl $-2147483648, %edi # imm = 0x80000000
-; X64-NEXT:    jne .LBB19_1
+; X64-NEXT:    movl %edi, %eax
----------------
RKSimon wrote:

I've been testing with hasOneUse but it isn't great as its purely down to final execution order - the abs tests can reuse the neg flag results in most cases. I'm going to see if X86FlagsCopyLowering can help us

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


More information about the llvm-commits mailing list