You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[LLVM][tests/CodeGen/RISCV] Convert instances of ConstantExpr based splats to use splat().
This is mostly NFC but some output does change due to consistently
inserting into poison rather than undef and using i64 as the index
type for inserts.
Copy file name to clipboardExpand all lines: llvm/test/CodeGen/RISCV/rvv/ctpop-sdnode.ll
+8-8
Original file line number
Diff line number
Diff line change
@@ -606,7 +606,7 @@ define <vscale x 16 x i1> @ctpop_nxv16i32_ult_two(<vscale x 16 x i32> %va) {
606
606
; CHECK-ZVBB-NEXT: vmsleu.vi v0, v8, 1
607
607
; CHECK-ZVBB-NEXT: ret
608
608
%a = call <vscale x 16 x i32> @llvm.ctpop.nxv16i32(<vscale x 16 x i32> %va)
609
-
%cmp = icmpult <vscale x 16 x i32> %a, shufflevector (<vscale x 16 x i32> insertelement (<vscale x 16 x i32> poison, i322, i640), <vscale x 16 x i32> poison, <vscale x 16 x i32> zeroinitializer)
609
+
%cmp = icmpult <vscale x 16 x i32> %a, splat (i322)
610
610
ret <vscale x 16 x i1> %cmp
611
611
}
612
612
@@ -626,7 +626,7 @@ define <vscale x 16 x i1> @ctpop_nxv16i32_ugt_one(<vscale x 16 x i32> %va) {
626
626
; CHECK-ZVBB-NEXT: vmsgtu.vi v0, v8, 1
627
627
; CHECK-ZVBB-NEXT: ret
628
628
%a = call <vscale x 16 x i32> @llvm.ctpop.nxv16i32(<vscale x 16 x i32> %va)
629
-
%cmp = icmpugt <vscale x 16 x i32> %a, shufflevector (<vscale x 16 x i32> insertelement (<vscale x 16 x i32> poison, i321, i640), <vscale x 16 x i32> poison, <vscale x 16 x i32> zeroinitializer)
629
+
%cmp = icmpugt <vscale x 16 x i32> %a, splat (i321)
630
630
ret <vscale x 16 x i1> %cmp
631
631
}
632
632
@@ -646,7 +646,7 @@ define <vscale x 16 x i1> @ctpop_nxv16i32_eq_one(<vscale x 16 x i32> %va) {
646
646
; CHECK-ZVBB-NEXT: vmseq.vi v0, v8, 1
647
647
; CHECK-ZVBB-NEXT: ret
648
648
%a = call <vscale x 16 x i32> @llvm.ctpop.nxv16i32(<vscale x 16 x i32> %va)
649
-
%cmp = icmpeq <vscale x 16 x i32> %a, shufflevector (<vscale x 16 x i32> insertelement (<vscale x 16 x i32> poison, i321, i640), <vscale x 16 x i32> poison, <vscale x 16 x i32> zeroinitializer)
649
+
%cmp = icmpeq <vscale x 16 x i32> %a, splat (i321)
650
650
ret <vscale x 16 x i1> %cmp
651
651
}
652
652
@@ -666,7 +666,7 @@ define <vscale x 16 x i1> @ctpop_nxv16i32_ne_one(<vscale x 16 x i32> %va) {
666
666
; CHECK-ZVBB-NEXT: vmsne.vi v0, v8, 1
667
667
; CHECK-ZVBB-NEXT: ret
668
668
%a = call <vscale x 16 x i32> @llvm.ctpop.nxv16i32(<vscale x 16 x i32> %va)
669
-
%cmp = icmpne <vscale x 16 x i32> %a, shufflevector (<vscale x 16 x i32> insertelement (<vscale x 16 x i32> poison, i321, i640), <vscale x 16 x i32> poison, <vscale x 16 x i32> zeroinitializer)
669
+
%cmp = icmpne <vscale x 16 x i32> %a, splat (i321)
670
670
ret <vscale x 16 x i1> %cmp
671
671
}
672
672
@@ -1020,7 +1020,7 @@ define <vscale x 8 x i1> @ctpop_nxv8i64_ult_two(<vscale x 8 x i64> %va) {
1020
1020
; CHECK-ZVBB-NEXT: vmsleu.vi v0, v8, 1
1021
1021
; CHECK-ZVBB-NEXT: ret
1022
1022
%a = call <vscale x 8 x i64> @llvm.ctpop.nxv8i64(<vscale x 8 x i64> %va)
1023
-
%cmp = icmpult <vscale x 8 x i64> %a, shufflevector (<vscale x 8 x i64> insertelement (<vscale x 8 x i64> poison, i642, i640), <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer)
1023
+
%cmp = icmpult <vscale x 8 x i64> %a, splat (i642)
1024
1024
ret <vscale x 8 x i1> %cmp
1025
1025
}
1026
1026
@@ -1040,7 +1040,7 @@ define <vscale x 8 x i1> @ctpop_nxv8i64_ugt_one(<vscale x 8 x i64> %va) {
1040
1040
; CHECK-ZVBB-NEXT: vmsgtu.vi v0, v8, 1
1041
1041
; CHECK-ZVBB-NEXT: ret
1042
1042
%a = call <vscale x 8 x i64> @llvm.ctpop.nxv8i64(<vscale x 8 x i64> %va)
1043
-
%cmp = icmpugt <vscale x 8 x i64> %a, shufflevector (<vscale x 8 x i64> insertelement (<vscale x 8 x i64> poison, i641, i640), <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer)
1043
+
%cmp = icmpugt <vscale x 8 x i64> %a, splat (i641)
1044
1044
ret <vscale x 8 x i1> %cmp
1045
1045
}
1046
1046
@@ -1060,7 +1060,7 @@ define <vscale x 8 x i1> @ctpop_nxv8i64_eq_one(<vscale x 8 x i64> %va) {
1060
1060
; CHECK-ZVBB-NEXT: vmseq.vi v0, v8, 1
1061
1061
; CHECK-ZVBB-NEXT: ret
1062
1062
%a = call <vscale x 8 x i64> @llvm.ctpop.nxv8i64(<vscale x 8 x i64> %va)
1063
-
%cmp = icmpeq <vscale x 8 x i64> %a, shufflevector (<vscale x 8 x i64> insertelement (<vscale x 8 x i64> poison, i641, i640), <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer)
1063
+
%cmp = icmpeq <vscale x 8 x i64> %a, splat (i641)
1064
1064
ret <vscale x 8 x i1> %cmp
1065
1065
}
1066
1066
@@ -1080,7 +1080,7 @@ define <vscale x 8 x i1> @ctpop_nxv8i64_ne_one(<vscale x 8 x i64> %va) {
1080
1080
; CHECK-ZVBB-NEXT: vmsne.vi v0, v8, 1
1081
1081
; CHECK-ZVBB-NEXT: ret
1082
1082
%a = call <vscale x 8 x i64> @llvm.ctpop.nxv8i64(<vscale x 8 x i64> %va)
1083
-
%cmp = icmpne <vscale x 8 x i64> %a, shufflevector (<vscale x 8 x i64> insertelement (<vscale x 8 x i64> poison, i641, i640), <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer)
%step = tailcall <vscale x 1 x i64> @llvm.experimental.stepvector.nxv1i64()
60
60
%gep = getelementptrinbounds%struct, ptr%p, <vscale x 1 x i64> %step, i326
61
-
tailcallvoid@llvm.masked.scatter.nxv1i64.nxv1p0(<vscale x 1 x i64> zeroinitializer, <vscale x 1 x ptr> %gep, i328, <vscale x 1 x i1> shufflevector (<vscale x 1 x i1> insertelement (<vscale x 1 x i1> poison, i1true, i320), <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer))
61
+
tailcallvoid@llvm.masked.scatter.nxv1i64.nxv1p0(<vscale x 1 x i64> zeroinitializer, <vscale x 1 x ptr> %gep, i328, <vscale x 1 x i1> splat (i1true))
%.splat = shufflevector <vscale x 1 x i64> %.splatinsert, <vscale x 1 x i64> poison, <vscale x 1 x i32> zeroinitializer
94
94
%add = add <vscale x 1 x i64> %step, %.splat
95
95
%gep = getelementptrinbounds%struct, ptr%p, <vscale x 1 x i64> %add, i326
96
-
tailcallvoid@llvm.masked.scatter.nxv1i64.nxv1p0(<vscale x 1 x i64> zeroinitializer, <vscale x 1 x ptr> %gep, i328, <vscale x 1 x i1> shufflevector (<vscale x 1 x i1> insertelement (<vscale x 1 x i1> poison, i1true, i320), <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer))
96
+
tailcallvoid@llvm.masked.scatter.nxv1i64.nxv1p0(<vscale x 1 x i64> zeroinitializer, <vscale x 1 x ptr> %gep, i328, <vscale x 1 x i1> splat (i1true))
%step = tailcall <vscale x 1 x i64> @llvm.experimental.stepvector.nxv1i64()
120
120
%gep = getelementptrinboundsi64, ptr%p, <vscale x 1 x i64> %step
121
-
tailcallvoid@llvm.masked.scatter.nxv1i64.nxv1p0(<vscale x 1 x i64> zeroinitializer, <vscale x 1 x ptr> %gep, i328, <vscale x 1 x i1> shufflevector (<vscale x 1 x i1> insertelement (<vscale x 1 x i1> poison, i1true, i320), <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer))
121
+
tailcallvoid@llvm.masked.scatter.nxv1i64.nxv1p0(<vscale x 1 x i64> zeroinitializer, <vscale x 1 x ptr> %gep, i328, <vscale x 1 x i1> splat (i1true))
Copy file name to clipboardExpand all lines: llvm/test/CodeGen/RISCV/rvv/pr61561.ll
+5-5
Original file line number
Diff line number
Diff line change
@@ -23,11 +23,11 @@ define <vscale x 4 x i8> @foo(ptr %p) {
23
23
; CHECK-NEXT: ret
24
24
%i13 = load <vscale x 4 x i16>, ptr%p, align2
25
25
%i14 = zext <vscale x 4 x i16> %i13to <vscale x 4 x i32>
26
-
%i15 = shlnuwnsw <vscale x 4 x i32> %i14, shufflevector (<vscale x 4 x i32> insertelement (<vscale x 4 x i32> poison, i323, i640), <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer)
27
-
%i16 = and <vscale x 4 x i32> %i15, shufflevector (<vscale x 4 x i32> insertelement (<vscale x 4 x i32> poison, i32248, i640), <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer)
28
-
%i17 = mulnuwnsw <vscale x 4 x i32> %i16, shufflevector (<vscale x 4 x i32> insertelement (<vscale x 4 x i32> poison, i323735, i640), <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer)
29
-
%i18 = addnuwnsw <vscale x 4 x i32> %i17, shufflevector (<vscale x 4 x i32> insertelement (<vscale x 4 x i32> poison, i3216384, i640), <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer)
30
-
%i21 = lshr <vscale x 4 x i32> %i18, shufflevector (<vscale x 4 x i32> insertelement (<vscale x 4 x i32> poison, i3215, i640), <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer)
26
+
%i15 = shlnuwnsw <vscale x 4 x i32> %i14, splat (i323)
27
+
%i16 = and <vscale x 4 x i32> %i15, splat (i32248)
28
+
%i17 = mulnuwnsw <vscale x 4 x i32> %i16, splat (i323735)
29
+
%i18 = addnuwnsw <vscale x 4 x i32> %i17, splat (i3216384)
30
+
%i21 = lshr <vscale x 4 x i32> %i18, splat (i3215)
31
31
%i22 = trunc <vscale x 4 x i32> %i21to <vscale x 4 x i8>
Copy file name to clipboardExpand all lines: llvm/test/CodeGen/RISCV/rvv/pr63459.ll
+1-1
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ define void @snork(ptr %arg, <vscale x 2 x i64> %arg1) {
14
14
; CHECK-NEXT: ret
15
15
bb:
16
16
%getelementptr = getelementptrinbounds <vscale x 2 x i32>, ptr%arg, <vscale x 2 x i64> %arg1
17
-
tailcallvoid@llvm.vp.scatter.nxv2i32.nxv2p0(<vscale x 2 x i32> shufflevector (<vscale x 2 x i32> insertelement (<vscale x 2 x i32> poison, i321, i320), <vscale x 2 x i32> poison, <vscale x 2 x i32> zeroinitializer), <vscale x 2 x ptr> align4%getelementptr, <vscale x 2 x i1> shufflevector (<vscale x 2 x i1> insertelement (<vscale x 2 x i1> poison, i1true, i640), <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer), i324)
17
+
tailcallvoid@llvm.vp.scatter.nxv2i32.nxv2p0(<vscale x 2 x i32> splat (i321), <vscale x 2 x ptr> align4%getelementptr, <vscale x 2 x i1> splat (i1true), i324)
Copy file name to clipboardExpand all lines: llvm/test/CodeGen/RISCV/rvv/stepvector.ll
+5-5
Original file line number
Diff line number
Diff line change
@@ -743,7 +743,7 @@ define <vscale x 2 x i64> @hi_bits_known_zero() vscale_range(2, 4) {
743
743
; CHECK-NEXT: vmv.v.i v8, 0
744
744
; CHECK-NEXT: ret
745
745
%step = call <vscale x 2 x i64> @llvm.experimental.stepvector.nxv2i64()
746
-
%and = and <vscale x 2 x i64> %step, shufflevector(<vscale x 2 x i64> insertelement(<vscale x 2 x i64> poison, i64u0xfffffffffffffff8, i320), <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer)
746
+
%and = and <vscale x 2 x i64> %step, splat (i64u0xfffffffffffffff8)
747
747
ret <vscale x 2 x i64> %and
748
748
}
749
749
@@ -758,8 +758,8 @@ define <vscale x 2 x i64> @hi_bits_known_zero_overflow() vscale_range(2, 4) {
758
758
; CHECK-NEXT: vand.vi v8, v8, -8
759
759
; CHECK-NEXT: ret
760
760
%step = call <vscale x 2 x i64> @llvm.experimental.stepvector.nxv2i64()
761
-
%step.mul = mul <vscale x 2 x i64> %step, shufflevector(<vscale x 2 x i64> insertelement(<vscale x 2 x i64> poison, i64u0xffffffffffffffff, i320), <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer)
762
-
%and = and <vscale x 2 x i64> %step.mul, shufflevector(<vscale x 2 x i64> insertelement(<vscale x 2 x i64> poison, i64u0xfffffffffffffff8, i320), <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer)
761
+
%step.mul = mul <vscale x 2 x i64> %step, splat (i64u0xffffffffffffffff)
762
+
%and = and <vscale x 2 x i64> %step.mul, splat (i64u0xfffffffffffffff8)
763
763
ret <vscale x 2 x i64> %and
764
764
}
765
765
@@ -771,7 +771,7 @@ define <vscale x 2 x i64> @lo_bits_known_zero() {
771
771
; CHECK-NEXT: vmv.v.i v8, 0
772
772
; CHECK-NEXT: ret
773
773
%step = call <vscale x 2 x i64> @llvm.experimental.stepvector.nxv2i64()
774
-
%step.mul = mul <vscale x 2 x i64> %step, shufflevector(<vscale x 2 x i64> insertelement(<vscale x 2 x i64> poison, i648, i320), <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer)
775
-
%and = and <vscale x 2 x i64> %step.mul, shufflevector(<vscale x 2 x i64> insertelement(<vscale x 2 x i64> poison, i647, i320), <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer)
774
+
%step.mul = mul <vscale x 2 x i64> %step, splat (i648)
775
+
%and = and <vscale x 2 x i64> %step.mul, splat (i647)
0 commit comments