[llvm] [SelectionDAG]: Deduce KnownNeverZero from SMIN and SMAX (PR #85722)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 24 10:57:00 PDT 2024


================
@@ -442,6 +445,88 @@ define i32 @smin_known_nonzero(i32 %xx, i32 %yy) {
   ret i32 %r
 }
 
+define i32 @smin_known_zero(i32 %x, i32 %y) {
+; CHECK-LABEL: smin_known_zero:
+; CHECK:       # %bb.0:
+; CHECK-NEXT:    cmpl $-54, %edi
+; CHECK-NEXT:    movl $-54, %eax
+; CHECK-NEXT:    cmovll %edi, %eax
+; CHECK-NEXT:    bsfl %eax, %ecx
+; CHECK-NEXT:    movl $32, %eax
+; CHECK-NEXT:    cmovnel %ecx, %eax
+; CHECK-NEXT:    retq
----------------
RKSimon wrote:

Remove the CHECK lines, we use X86 and X64 in the file now.

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


More information about the llvm-commits mailing list