RegisterCoalescer: Cleanup empty subranges after shrinkToUses()
[oota-llvm.git] / test / CodeGen / AMDGPU / subreg-coalescer-undef-use.ll
1 ; RUN: llc -march=amdgcn -mcpu=SI -o /dev/null %s
2 ; Don't crash when the use of an undefined value is only detected by the
3 ; register coalescer because it is hidden with subregister insert/extract.
4 target triple="amdgcn--"
5
6 define void @foobar(float %a0, float %a1, float addrspace(1)* %out) nounwind {
7 entry:
8   %v0 = insertelement <4 x float> undef, float %a0, i32 0
9   br i1 undef, label %ift, label %ife
10
11 ift:
12   %v1 = insertelement <4 x float> undef, float %a1, i32 0
13   br label %ife
14
15 ife:
16   %val = phi <4 x float> [ %v1, %ift ], [ %v0, %entry ]
17   %v2 = extractelement <4 x float> %val, i32 1
18   store float %v2, float addrspace(1)* %out, align 4
19   ret void
20 }