diff options
author | Matthias Braun <matze@braunis.de> | 2016-03-24 21:41:38 +0000 |
---|---|---|
committer | Matthias Braun <matze@braunis.de> | 2016-03-24 21:41:38 +0000 |
commit | ae81c293521887284aca35059070bc688bcae771 (patch) | |
tree | 839507149b06b32b35c39ea8071d5a482a1b2b99 /llvm/lib/CodeGen/LiveInterval.cpp | |
parent | e09d035dad21efbcd98b3f8c58af75709cc034e5 (diff) | |
download | bcm5719-llvm-ae81c293521887284aca35059070bc688bcae771.tar.gz bcm5719-llvm-ae81c293521887284aca35059070bc688bcae771.zip |
LiveInterval: Fix Distribute() failing on liveranges with unused VNInfos
This fixes http://llvm.org/PR26991
llvm-svn: 264345
Diffstat (limited to 'llvm/lib/CodeGen/LiveInterval.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveInterval.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/LiveInterval.cpp b/llvm/lib/CodeGen/LiveInterval.cpp index ab780729347..171d18aa9c4 100644 --- a/llvm/lib/CodeGen/LiveInterval.cpp +++ b/llvm/lib/CodeGen/LiveInterval.cpp @@ -1483,15 +1483,20 @@ void ConnectedVNInfoEqClasses::Distribute(LiveInterval &LI, LiveInterval *LIV[], SubRanges.resize(NumComponents-1, nullptr); for (unsigned I = 0; I < NumValNos; ++I) { const VNInfo &VNI = *SR.valnos[I]; - const VNInfo *MainRangeVNI = LI.getVNInfoAt(VNI.def); - assert(MainRangeVNI != nullptr - && "SubRange def must have corresponding main range def"); - unsigned ComponentNum = getEqClass(MainRangeVNI); - VNIMapping.push_back(ComponentNum); - if (ComponentNum > 0 && SubRanges[ComponentNum-1] == nullptr) { - SubRanges[ComponentNum-1] - = LIV[ComponentNum-1]->createSubRange(Allocator, SR.LaneMask); + unsigned ComponentNum; + if (VNI.isUnused()) { + ComponentNum = 0; + } else { + const VNInfo *MainRangeVNI = LI.getVNInfoAt(VNI.def); + assert(MainRangeVNI != nullptr + && "SubRange def must have corresponding main range def"); + ComponentNum = getEqClass(MainRangeVNI); + if (ComponentNum > 0 && SubRanges[ComponentNum-1] == nullptr) { + SubRanges[ComponentNum-1] + = LIV[ComponentNum-1]->createSubRange(Allocator, SR.LaneMask); + } } + VNIMapping.push_back(ComponentNum); } DistributeRange(SR, SubRanges.data(), VNIMapping); } |