1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -instsimplify -S | FileCheck %s
6 define i129 @vec_extract_negidx(<3 x i129> %a) {
7 ; CHECK-LABEL: @vec_extract_negidx(
8 ; CHECK-NEXT: ret i129 undef
10 %E1 = extractelement <3 x i129> %a, i129 -1
14 define i129 @vec_extract_out_of_bounds(<3 x i129> %a) {
15 ; CHECK-LABEL: @vec_extract_out_of_bounds(
16 ; CHECK-NEXT: ret i129 undef
18 %E1 = extractelement <3 x i129> %a, i129 3
22 define i129 @vec_extract_out_of_bounds2(<3 x i129> %a) {
23 ; CHECK-LABEL: @vec_extract_out_of_bounds2(
24 ; CHECK-NEXT: ret i129 undef
26 %E1 = extractelement <3 x i129> %a, i129 999999999999999
31 define i129 @vec_extract_undef_index(<3 x i129> %a) {
32 ; CHECK-LABEL: @vec_extract_undef_index(
33 ; CHECK-NEXT: ret i129 undef
35 %E1 = extractelement <3 x i129> %a, i129 undef
40 define i129 @vec_extract_in_bounds(<3 x i129> %a) {
41 ; CHECK-LABEL: @vec_extract_in_bounds(
42 ; CHECK-NEXT: [[E1:%.*]] = extractelement <3 x i129> [[A:%.*]], i129 2
43 ; CHECK-NEXT: ret i129 [[E1]]
45 %E1 = extractelement <3 x i129> %a, i129 2
49 define float @extract_element_splat_constant_vector_variable_index(i32 %y) {
50 ; CHECK-LABEL: @extract_element_splat_constant_vector_variable_index(
51 ; CHECK-NEXT: ret float 2.000000e+00
53 %r = extractelement <4 x float> <float 2.0, float 2.0, float 2.0, float 2.0>, i32 %y