1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=instcombine -S | grep "insertelement <4 x float> poison"
4 ; Instcombine should be able to prove that none of the
5 ; insertelement's first operand's elements are needed.
7 define internal void @""(ptr) {
9 bitcast ptr %0 to ptr ; <ptr>:2 [#uses=1]
10 load i32, ptr %2, align 1 ; <i32>:3 [#uses=1]
11 getelementptr i8, ptr %0, i32 4 ; <ptr>:4 [#uses=1]
12 bitcast ptr %4 to ptr ; <ptr>:5 [#uses=1]
13 load i32, ptr %5, align 1 ; <i32>:6 [#uses=1]
16 ; <label>:7 ; preds = %9, %1
17 %.01 = phi <4 x float> [ undef, %1 ], [ %12, %9 ] ; <<4 x float>> [#uses=1]
18 %.0 = phi i32 [ %3, %1 ], [ %15, %9 ] ; <i32> [#uses=3]
19 icmp slt i32 %.0, %6 ; <i1>:8 [#uses=1]
20 br i1 %8, label %9, label %16
22 ; <label>:9 ; preds = %7
23 sitofp i32 %.0 to float ; <float>:10 [#uses=1]
24 insertelement <4 x float> %.01, float %10, i32 0 ; <<4 x float>>:11 [#uses=1]
25 shufflevector <4 x float> %11, <4 x float> poison, <4 x i32> zeroinitializer ; <<4 x float>>:12 [#uses=2]
26 getelementptr i8, ptr %0, i32 48 ; <ptr>:13 [#uses=1]
27 bitcast ptr %13 to ptr ; <ptr>:14 [#uses=1]
28 store <4 x float> %12, ptr %14, align 16
29 add i32 %.0, 2 ; <i32>:15 [#uses=1]
32 ; <label>:16 ; preds = %7