summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveRegMatrix.cpp
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2015-07-14 17:38:17 +0000
committerMatthias Braun <matze@braunis.de>2015-07-14 17:38:17 +0000
commit953393a72cc0819146d8ada5dc1b84653ecbc73b (patch)
treea8be3757caa6f79d690f7862d70e676f88379147 /llvm/lib/CodeGen/LiveRegMatrix.cpp
parent4ba525b727a416ad688d0237f9f7e6fd697a3c1f (diff)
downloadbcm5719-llvm-953393a72cc0819146d8ada5dc1b84653ecbc73b.tar.gz
bcm5719-llvm-953393a72cc0819146d8ada5dc1b84653ecbc73b.zip
RAGreedy: Keep track of allocated PhysRegs internally
Do not use MachineRegisterInfo::setPhysRegUsed()/isPhysRegUsed() anymore. This bitset changes function-global state and is set by the VirtRegRewriter anyway. Simply use a bitvector private to RAGreedy. Differential Revision: http://reviews.llvm.org/D10910 llvm-svn: 242169
Diffstat (limited to 'llvm/lib/CodeGen/LiveRegMatrix.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveRegMatrix.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/LiveRegMatrix.cpp b/llvm/lib/CodeGen/LiveRegMatrix.cpp
index 154ce6fc122..9ea031d38d2 100644
--- a/llvm/lib/CodeGen/LiveRegMatrix.cpp
+++ b/llvm/lib/CodeGen/LiveRegMatrix.cpp
@@ -131,6 +131,14 @@ void LiveRegMatrix::unassign(LiveInterval &VirtReg) {
DEBUG(dbgs() << '\n');
}
+bool LiveRegMatrix::isPhysRegUsed(unsigned PhysReg) const {
+ for (MCRegUnitIterator Unit(PhysReg, TRI); Unit.isValid(); ++Unit) {
+ if (!Matrix[*Unit].empty())
+ return true;
+ }
+ return false;
+}
+
bool LiveRegMatrix::checkRegMaskInterference(LiveInterval &VirtReg,
unsigned PhysReg) {
// Check if the cached information is valid.
OpenPOWER on IntegriCloud