1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
2 ; RUN: opt -passes=instcombine -S < %s | FileCheck %s
4 define void @test_undef(ptr %in_ptr, ptr %out_ptr) {
5 ; CHECK-LABEL: define void @test_undef(
6 ; CHECK-SAME: ptr [[IN_PTR:%.*]], ptr [[OUT_PTR:%.*]]) {
7 ; CHECK-NEXT: [[A:%.*]] = load <4 x float>, ptr [[IN_PTR]], align 16
8 ; CHECK-NEXT: [[D:%.*]] = shufflevector <4 x float> [[A]], <4 x float> poison, <4 x i32> zeroinitializer
9 ; CHECK-NEXT: store <4 x float> [[D]], ptr [[OUT_PTR]], align 16
10 ; CHECK-NEXT: ret void
12 %A = load <4 x float>, ptr %in_ptr, align 16
13 %B = shufflevector <4 x float> %A, <4 x float> undef, <4 x i32> <i32 0, i32 0, i32 undef, i32 undef>
14 %C = shufflevector <4 x float> %B, <4 x float> %A, <4 x i32> <i32 0, i32 1, i32 4, i32 undef>
15 %D = shufflevector <4 x float> %C, <4 x float> %A, <4 x i32> <i32 0, i32 1, i32 2, i32 4>
16 store <4 x float> %D, ptr %out_ptr
20 define void @test_poison(ptr %in_ptr, ptr %out_ptr) {
21 ; CHECK-LABEL: define void @test_poison(
22 ; CHECK-SAME: ptr [[IN_PTR:%.*]], ptr [[OUT_PTR:%.*]]) {
23 ; CHECK-NEXT: [[A:%.*]] = load <4 x float>, ptr [[IN_PTR]], align 16
24 ; CHECK-NEXT: [[D:%.*]] = shufflevector <4 x float> [[A]], <4 x float> poison, <4 x i32> zeroinitializer
25 ; CHECK-NEXT: store <4 x float> [[D]], ptr [[OUT_PTR]], align 16
26 ; CHECK-NEXT: ret void
28 %A = load <4 x float>, ptr %in_ptr, align 16
29 %B = shufflevector <4 x float> %A, <4 x float> poison, <4 x i32> <i32 0, i32 0, i32 undef, i32 undef>
30 %C = shufflevector <4 x float> %B, <4 x float> %A, <4 x i32> <i32 0, i32 1, i32 4, i32 undef>
31 %D = shufflevector <4 x float> %C, <4 x float> %A, <4 x i32> <i32 0, i32 1, i32 2, i32 4>
32 store <4 x float> %D, ptr %out_ptr