[llvm] [SDAG] Freeze condition in select of load fold (PR #208683)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 10 03:12:37 PDT 2026


================
@@ -172,8 +172,10 @@ define i32 @selecti8i32(i8 %a) {
 define i32 @icmpasreq(i32 %input, i32 %a, i32 %b) {
 ; X86-LABEL: icmpasreq:
 ; X86:       # %bb.0:
-; X86-NEXT:    cmpl $0, {{[0-9]+}}(%esp)
-; X86-NEXT:    js .LBB8_1
+; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT:    sarl $31, %eax
+; X86-NEXT:    cmpl $-1, %eax
+; X86-NEXT:    je .LBB8_1
----------------
nikic wrote:

Regression because we don't push freeze through sra: https://github.com/llvm/llvm-project/blob/99fb741b6e0da866bf3c6000531104bff347d787/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp#L18242-L18246

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


More information about the llvm-commits mailing list