[llvm] [LLVM][IR] Teach constant integer binop folds about vector ConstantInts. (PR #115739)

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 12 02:53:41 PST 2024


================
@@ -399,10 +400,15 @@ define i32 @test30(i32 %A) {
 }
 
 define <2 x i32> @test30vec(<2 x i32> %A) {
-; CHECK-LABEL: @test30vec(
-; CHECK-NEXT:    [[TMP1:%.*]] = and <2 x i32> [[A:%.*]], splat (i32 -58312)
-; CHECK-NEXT:    [[E:%.*]] = or disjoint <2 x i32> [[TMP1]], splat (i32 32962)
-; CHECK-NEXT:    ret <2 x i32> [[E]]
+; CONSTVEC-LABEL: @test30vec(
+; CONSTVEC-NEXT:    [[TMP1:%.*]] = and <2 x i32> [[A:%.*]], splat (i32 -58312)
+; CONSTVEC-NEXT:    [[E:%.*]] = or disjoint <2 x i32> [[TMP1]], splat (i32 32962)
+; CONSTVEC-NEXT:    ret <2 x i32> [[E]]
+;
+; CONSTSPLAT-LABEL: @test30vec(
+; CONSTSPLAT-NEXT:    [[D:%.*]] = and <2 x i32> [[A:%.*]], splat (i32 -58312)
+; CONSTSPLAT-NEXT:    [[E:%.*]] = or disjoint <2 x i32> [[D]], splat (i32 32962)
+; CONSTSPLAT-NEXT:    ret <2 x i32> [[E]]
----------------
paulwalker-arm wrote:

Yes.  My guess is that we're now going down a path where the original name is preserved.  I was going to ignore it but then remembered how it bugs me when I run the update scripts and end up with a bunch of changes unrelated to my PR.

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


More information about the llvm-commits mailing list