[llvm] [InstCombine] canonicalize sign bit checks (PR #122962)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 15 08:57:23 PST 2025


================
@@ -1004,18 +1004,17 @@ define void @eq_smin_v2i32_constant(<2 x i32> %y) {
 ; icmp pred smin(C1, Y), C2 where C1 < C2
 define void @slt_smin_v2i32_constant(<2 x i32> %y) {
 ; CHECK-LABEL: @slt_smin_v2i32_constant(
-; CHECK-NEXT:    [[COND:%.*]] = call <2 x i32> @llvm.smin.v2i32(<2 x i32> [[Y:%.*]], <2 x i32> splat (i32 5))
 ; CHECK-NEXT:    call void @use_v2i1(<2 x i1> splat (i1 true))
 ; CHECK-NEXT:    call void @use_v2i1(<2 x i1> splat (i1 true))
 ; CHECK-NEXT:    call void @use_v2i1(<2 x i1> zeroinitializer)
 ; CHECK-NEXT:    call void @use_v2i1(<2 x i1> zeroinitializer)
-; CHECK-NEXT:    [[CMP5:%.*]] = icmp ult <2 x i32> [[COND]], splat (i32 10)
+; CHECK-NEXT:    [[CMP5:%.*]] = icmp sgt <2 x i32> [[Y:%.*]], splat (i32 -1)
 ; CHECK-NEXT:    call void @use_v2i1(<2 x i1> [[CMP5]])
-; CHECK-NEXT:    [[CMP6:%.*]] = icmp ult <2 x i32> [[COND]], splat (i32 11)
----------------
goldsteinn wrote:

These two cases don't look profitable.

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


More information about the llvm-commits mailing list