llvm.org GIT mirror llvm / 1a5b04c
RegisterCoalescer: Cleanup empty subranges after shrinkToUses() A call to removeEmptySubranges() is necessary after every operation that potentially removes all segments from a subregister range; this case in the register coalescer was missing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241027 91177308-0d34-0410-b5e6-96231b3b80d8 Matthias Braun 4 years ago
2 changed file(s) with 21 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
14481448 << format("%04X", S.LaneMask) << ")\n");
14491449 LIS->shrinkToUses(S, LI.reg);
14501450 }
1451 LI.removeEmptySubRanges();
14511452 }
14521453 if (ShrinkMainRange) {
14531454 LiveInterval &LI = LIS->getInterval(CP.getDstReg());
0 ; RUN: llc -march=amdgcn -mcpu=SI -o /dev/null %s
1 ; Don't crash when the use of an undefined value is only detected by the
2 ; register coalescer because it is hidden with subregister insert/extract.
3 target triple="amdgcn--"
4
5 define void @foobar(float %a0, float %a1, float addrspace(1)* %out) nounwind {
6 entry:
7 %v0 = insertelement <4 x float> undef, float %a0, i32 0
8 br i1 undef, label %ift, label %ife
9
10 ift:
11 %v1 = insertelement <4 x float> undef, float %a1, i32 0
12 br label %ife
13
14 ife:
15 %val = phi <4 x float> [ %v1, %ift ], [ %v0, %entry ]
16 %v2 = extractelement <4 x float> %val, i32 1
17 store float %v2, float addrspace(1)* %out, align 4
18 ret void
19 }