1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -constprop -S | FileCheck %s
6 ; CHECK-NEXT: ret i32 2139171423
8 %A = bitcast i32 2139171423 to float
9 %B = insertelement <1 x float> undef, float %A, i32 0
10 %C = extractelement <1 x float> %B, i32 0
11 %D = bitcast float %C to i32
15 define <4 x i64> @insertelement() {
16 ; CHECK-LABEL: @insertelement(
17 ; CHECK-NEXT: ret <4 x i64> <i64 -1, i64 -2, i64 -3, i64 -4>
19 %vec1 = insertelement <4 x i64> undef, i64 -1, i32 0
20 %vec2 = insertelement <4 x i64> %vec1, i64 -2, i32 1
21 %vec3 = insertelement <4 x i64> %vec2, i64 -3, i32 2
22 %vec4 = insertelement <4 x i64> %vec3, i64 -4, i32 3
26 define <4 x i64> @insertelement_undef() {
27 ; CHECK-LABEL: @insertelement_undef(
28 ; CHECK-NEXT: [[VEC4:%.*]] = insertelement <4 x i64> <i64 -1, i64 -2, i64 -3, i64 undef>, i64 -4, i32 3
29 ; CHECK-NEXT: ret <4 x i64> undef
31 %vec1 = insertelement <4 x i64> undef, i64 -1, i32 0
32 %vec2 = insertelement <4 x i64> %vec1, i64 -2, i32 1
33 %vec3 = insertelement <4 x i64> %vec2, i64 -3, i32 2
34 %vec4 = insertelement <4 x i64> %vec3, i64 -4, i32 3
35 %vec5 = insertelement <4 x i64> %vec3, i64 -5, i32 4
39 define i64 @extract_undef_index_from_zero_vec() {
40 ; CHECK-LABEL: @extract_undef_index_from_zero_vec(
41 ; CHECK-NEXT: ret i64 undef
43 %E = extractelement <2 x i64> zeroinitializer, i64 undef
47 define i64 @extract_undef_index_from_nonzero_vec() {
48 ; CHECK-LABEL: @extract_undef_index_from_nonzero_vec(
49 ; CHECK-NEXT: ret i64 undef
51 %E = extractelement <2 x i64> <i64 -1, i64 -1>, i64 undef