aboutsummaryrefslogtreecommitdiff
path: root/llvm
diff options
context:
space:
mode:
authorNoah Goldstein <goldstein.w.n@gmail.com>2024-04-03 21:32:47 -0500
committerNoah Goldstein <goldstein.w.n@gmail.com>2024-04-06 17:51:15 -0500
commitd5b48ceb74e3ef83487f7220c6e2130195c07cc6 (patch)
treebcb7ed26ecbc1e53105d7e276b8944cbbb1f74aa /llvm
parent8e98435ae9eb34f04c4b1b97975f152c4ba63ba3 (diff)
downloadllvm-d5b48ceb74e3ef83487f7220c6e2130195c07cc6.zip
llvm-d5b48ceb74e3ef83487f7220c6e2130195c07cc6.tar.gz
llvm-d5b48ceb74e3ef83487f7220c6e2130195c07cc6.tar.bz2
[ValueTracking] Add tests for non-constant idx for fpclass of `insertelement`; NFC
Diffstat (limited to 'llvm')
-rw-r--r--llvm/test/Transforms/Attributor/nofpclass.ll19
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/test/Transforms/Attributor/nofpclass.ll b/llvm/test/Transforms/Attributor/nofpclass.ll
index 4df647c..501c6d5 100644
--- a/llvm/test/Transforms/Attributor/nofpclass.ll
+++ b/llvm/test/Transforms/Attributor/nofpclass.ll
@@ -1513,6 +1513,25 @@ define <4 x float> @insertelement_constant_chain() {
ret <4 x float> %ins.3
}
+define <4 x float> @insertelement_non_constant_chain(i32 %idx) {
+; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
+; CHECK-LABEL: define <4 x float> @insertelement_non_constant_chain
+; CHECK-SAME: (i32 [[IDX:%.*]]) #[[ATTR3]] {
+; CHECK-NEXT: [[INS_0:%.*]] = insertelement <4 x float> poison, float 1.000000e+00, i32 0
+; CHECK-NEXT: [[INS_1:%.*]] = insertelement <4 x float> [[INS_0]], float 0.000000e+00, i32 1
+; CHECK-NEXT: [[INS_2:%.*]] = insertelement <4 x float> [[INS_1]], float -9.000000e+00, i32 2
+; CHECK-NEXT: [[INS_4:%.*]] = insertelement <4 x float> [[INS_2]], float 3.000000e+00, i32 3
+; CHECK-NEXT: [[INS_3:%.*]] = insertelement <4 x float> [[INS_2]], float 4.000000e+00, i32 [[IDX]]
+; CHECK-NEXT: ret <4 x float> [[INS_3]]
+;
+ %ins.0 = insertelement <4 x float> poison, float 1.0, i32 0
+ %ins.1 = insertelement <4 x float> %ins.0, float 0.0, i32 1
+ %ins.2 = insertelement <4 x float> %ins.1, float -9.0, i32 2
+ %ins.3 = insertelement <4 x float> %ins.2, float 3.0, i32 3
+ %ins.4 = insertelement <4 x float> %ins.2, float 4.0, i32 %idx
+ ret <4 x float> %ins.4
+}
+
define <vscale x 4 x float> @insertelement_scalable_constant_chain() {
; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
; CHECK-LABEL: define <vscale x 4 x float> @insertelement_scalable_constant_chain