Skip to content

Commit 6ace81d

Browse files
committed
[VectorCombine] add test with out-of-bounds insert/extract index; NFC
D135278
1 parent e66cfb6 commit 6ace81d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

llvm/test/Transforms/VectorCombine/X86/extract-fneg-insert.ll

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,16 @@ define <2 x double> @ext1_v2f64_ins0(<2 x double> %x, <2 x double> %y) {
115115
%r = insertelement <2 x double> %y, double %n, i32 0
116116
ret <2 x double> %r
117117
}
118+
119+
define <4 x float> @ext12_v4f32(<4 x float> %x, <4 x float> %y) {
120+
; CHECK-LABEL: @ext12_v4f32(
121+
; CHECK-NEXT: [[E:%.*]] = extractelement <4 x float> [[X:%.*]], i32 12
122+
; CHECK-NEXT: [[N:%.*]] = fneg float [[E]]
123+
; CHECK-NEXT: [[R:%.*]] = insertelement <4 x float> [[Y:%.*]], float [[N]], i32 12
124+
; CHECK-NEXT: ret <4 x float> [[R]]
125+
;
126+
%e = extractelement <4 x float> %x, i32 12
127+
%n = fneg float %e
128+
%r = insertelement <4 x float> %y, float %n, i32 12
129+
ret <4 x float> %r
130+
}

0 commit comments

Comments
 (0)