Skip to content

Commit d5b48ce

Browse files
committed
[ValueTracking] Add tests for non-constant idx for fpclass of insertelement; NFC
1 parent 8e98435 commit d5b48ce

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

llvm/test/Transforms/Attributor/nofpclass.ll

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1513,6 +1513,25 @@ define <4 x float> @insertelement_constant_chain() {
15131513
ret <4 x float> %ins.3
15141514
}
15151515

1516+
define <4 x float> @insertelement_non_constant_chain(i32 %idx) {
1517+
; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
1518+
; CHECK-LABEL: define <4 x float> @insertelement_non_constant_chain
1519+
; CHECK-SAME: (i32 [[IDX:%.*]]) #[[ATTR3]] {
1520+
; CHECK-NEXT: [[INS_0:%.*]] = insertelement <4 x float> poison, float 1.000000e+00, i32 0
1521+
; CHECK-NEXT: [[INS_1:%.*]] = insertelement <4 x float> [[INS_0]], float 0.000000e+00, i32 1
1522+
; CHECK-NEXT: [[INS_2:%.*]] = insertelement <4 x float> [[INS_1]], float -9.000000e+00, i32 2
1523+
; CHECK-NEXT: [[INS_4:%.*]] = insertelement <4 x float> [[INS_2]], float 3.000000e+00, i32 3
1524+
; CHECK-NEXT: [[INS_3:%.*]] = insertelement <4 x float> [[INS_2]], float 4.000000e+00, i32 [[IDX]]
1525+
; CHECK-NEXT: ret <4 x float> [[INS_3]]
1526+
;
1527+
%ins.0 = insertelement <4 x float> poison, float 1.0, i32 0
1528+
%ins.1 = insertelement <4 x float> %ins.0, float 0.0, i32 1
1529+
%ins.2 = insertelement <4 x float> %ins.1, float -9.0, i32 2
1530+
%ins.3 = insertelement <4 x float> %ins.2, float 3.0, i32 3
1531+
%ins.4 = insertelement <4 x float> %ins.2, float 4.0, i32 %idx
1532+
ret <4 x float> %ins.4
1533+
}
1534+
15161535
define <vscale x 4 x float> @insertelement_scalable_constant_chain() {
15171536
; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
15181537
; CHECK-LABEL: define <vscale x 4 x float> @insertelement_scalable_constant_chain

0 commit comments

Comments
 (0)