1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt %s -passes='function(scalarizer)' -S -o - | FileCheck %s
4 ; This input caused the scalarizer to replace & erase gathered results when
5 ; future gathered results depended on them being alive
7 define dllexport spir_func <4 x i32> @main(float %a) {
10 ; CHECK-NEXT: br label [[Z:%.*]]
12 ; CHECK-NEXT: [[F_UPTO0:%.*]] = insertelement <4 x i32> poison, i32 [[B_I0:%.*]], i64 0
13 ; CHECK-NEXT: [[F_UPTO1:%.*]] = insertelement <4 x i32> [[F_UPTO0]], i32 [[B_I0]], i64 1
14 ; CHECK-NEXT: [[F_UPTO2:%.*]] = insertelement <4 x i32> [[F_UPTO1]], i32 [[B_I0]], i64 2
15 ; CHECK-NEXT: [[F:%.*]] = insertelement <4 x i32> [[F_UPTO2]], i32 [[B_I0]], i64 3
16 ; CHECK-NEXT: ret <4 x i32> [[F]]
18 ; CHECK-NEXT: [[B_I0]] = bitcast float [[A:%.*]] to i32
19 ; CHECK-NEXT: br label [[Y:%.*]]
22 %i = insertelement <4 x float> undef, float %a, i32 0
26 %f = shufflevector <4 x i32> %b, <4 x i32> undef, <4 x i32> zeroinitializer
30 %b = bitcast <4 x float> %i to <4 x i32>