forked from OSchip/llvm-project
[InstSimplify][test] add test for extract of splat; NFC
This is shown in: https://llvm.org/PR50817
This commit is contained in:
parent
e13c62a103
commit
3ba090e5f6
|
@ -27,7 +27,6 @@ define i129 @vec_extract_out_of_bounds2(<3 x i129> %a) {
|
|||
ret i129 %E1
|
||||
}
|
||||
|
||||
|
||||
define i129 @vec_extract_undef_index(<3 x i129> %a) {
|
||||
; CHECK-LABEL: @vec_extract_undef_index(
|
||||
; CHECK-NEXT: ret i129 poison
|
||||
|
@ -36,7 +35,6 @@ define i129 @vec_extract_undef_index(<3 x i129> %a) {
|
|||
ret i129 %E1
|
||||
}
|
||||
|
||||
|
||||
define i129 @vec_extract_poison_index(<3 x i129> %a) {
|
||||
; CHECK-LABEL: @vec_extract_poison_index(
|
||||
; CHECK-NEXT: ret i129 poison
|
||||
|
@ -45,7 +43,6 @@ define i129 @vec_extract_poison_index(<3 x i129> %a) {
|
|||
ret i129 %E1
|
||||
}
|
||||
|
||||
|
||||
define i129 @vec_extract_in_bounds(<3 x i129> %a) {
|
||||
; CHECK-LABEL: @vec_extract_in_bounds(
|
||||
; CHECK-NEXT: [[E1:%.*]] = extractelement <3 x i129> [[A:%.*]], i129 2
|
||||
|
@ -63,3 +60,15 @@ define float @extract_element_splat_constant_vector_variable_index(i32 %y) {
|
|||
ret float %r
|
||||
}
|
||||
|
||||
define i32 @extractelement_splat_variable_index(i32 %v, i32 %index) {
|
||||
; CHECK-LABEL: @extractelement_splat_variable_index(
|
||||
; CHECK-NEXT: [[IN:%.*]] = insertelement <3 x i32> poison, i32 [[V:%.*]], i32 0
|
||||
; CHECK-NEXT: [[SPLAT:%.*]] = shufflevector <3 x i32> [[IN]], <3 x i32> poison, <3 x i32> zeroinitializer
|
||||
; CHECK-NEXT: [[R:%.*]] = extractelement <3 x i32> [[SPLAT]], i32 [[INDEX:%.*]]
|
||||
; CHECK-NEXT: ret i32 [[R]]
|
||||
;
|
||||
%in = insertelement <3 x i32> poison, i32 %v, i32 0
|
||||
%splat = shufflevector <3 x i32> %in, <3 x i32> poison, <3 x i32> zeroinitializer
|
||||
%r = extractelement <3 x i32> %splat, i32 %index
|
||||
ret i32 %r
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue