summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/RegAllocGreedy.cpp
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2017-03-03 23:27:20 +0000
committerMatthias Braun <matze@braunis.de>2017-03-03 23:27:20 +0000
commitffe40dd69e47236275637bc8c0a5561ff37b6a3f (patch)
tree34ca3907fcc7497b25a2c6a42713af6b7e0ccbc3 /llvm/lib/CodeGen/RegAllocGreedy.cpp
parent65a16dd85811f385f36c8d94bb960d88dce9a6c9 (diff)
downloadbcm5719-llvm-ffe40dd69e47236275637bc8c0a5561ff37b6a3f.tar.gz
bcm5719-llvm-ffe40dd69e47236275637bc8c0a5561ff37b6a3f.zip
RegAllocGreedy: Follow-up to r296722
We can now end up in situations where we initiate LiveIntervalUnion queries with different SubRanges against the same register unit, so the assert() no longer holds in all cases. Just recalculate now when we know the cache is out of date. llvm-svn: 296928
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocGreedy.cpp')
-rw-r--r--llvm/lib/CodeGen/RegAllocGreedy.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/RegAllocGreedy.cpp b/llvm/lib/CodeGen/RegAllocGreedy.cpp
index 6ec0c821e9d..06500289c97 100644
--- a/llvm/lib/CodeGen/RegAllocGreedy.cpp
+++ b/llvm/lib/CodeGen/RegAllocGreedy.cpp
@@ -849,7 +849,11 @@ void RAGreedy::evictInterference(LiveInterval &VirtReg, unsigned PhysReg,
SmallVector<LiveInterval*, 8> Intfs;
for (MCRegUnitIterator Units(PhysReg, TRI); Units.isValid(); ++Units) {
LiveIntervalUnion::Query &Q = Matrix->query(VirtReg, *Units);
- assert(Q.seenAllInterferences() && "Didn't check all interfererences.");
+ // We usually have the interfering VRegs cached so collectInterferingVRegs()
+ // should be fast, we may need to recalculate if when different physregs
+ // overlap the same register unit so we had different SubRanges queried
+ // against it.
+ Q.collectInterferingVRegs();
ArrayRef<LiveInterval*> IVR = Q.interferingVRegs();
Intfs.append(IVR.begin(), IVR.end());
}
OpenPOWER on IntegriCloud