mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-10-06 14:57:41 +00:00
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
This commit is contained in:
parent
7ce02c1c96
commit
1a5b04c725
@ -1449,6 +1449,7 @@ bool RegisterCoalescer::joinCopy(MachineInstr *CopyMI, bool &Again) {
|
|||||||
<< format("%04X", S.LaneMask) << ")\n");
|
<< format("%04X", S.LaneMask) << ")\n");
|
||||||
LIS->shrinkToUses(S, LI.reg);
|
LIS->shrinkToUses(S, LI.reg);
|
||||||
}
|
}
|
||||||
|
LI.removeEmptySubRanges();
|
||||||
}
|
}
|
||||||
if (ShrinkMainRange) {
|
if (ShrinkMainRange) {
|
||||||
LiveInterval &LI = LIS->getInterval(CP.getDstReg());
|
LiveInterval &LI = LIS->getInterval(CP.getDstReg());
|
||||||
|
20
test/CodeGen/AMDGPU/subreg-coalescer-undef-use.ll
Normal file
20
test/CodeGen/AMDGPU/subreg-coalescer-undef-use.ll
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
; RUN: llc -march=amdgcn -mcpu=SI -o /dev/null %s
|
||||||
|
; Don't crash when the use of an undefined value is only detected by the
|
||||||
|
; register coalescer because it is hidden with subregister insert/extract.
|
||||||
|
target triple="amdgcn--"
|
||||||
|
|
||||||
|
define void @foobar(float %a0, float %a1, float addrspace(1)* %out) nounwind {
|
||||||
|
entry:
|
||||||
|
%v0 = insertelement <4 x float> undef, float %a0, i32 0
|
||||||
|
br i1 undef, label %ift, label %ife
|
||||||
|
|
||||||
|
ift:
|
||||||
|
%v1 = insertelement <4 x float> undef, float %a1, i32 0
|
||||||
|
br label %ife
|
||||||
|
|
||||||
|
ife:
|
||||||
|
%val = phi <4 x float> [ %v1, %ift ], [ %v0, %entry ]
|
||||||
|
%v2 = extractelement <4 x float> %val, i32 1
|
||||||
|
store float %v2, float addrspace(1)* %out, align 4
|
||||||
|
ret void
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user