summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/RegisterPressure.cpp
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2013-08-30 17:58:49 +0000
committerAndrew Trick <atrick@apple.com>2013-08-30 17:58:49 +0000
commit3bf33075ce98e380fc0ba7aeb5928f1151019887 (patch)
tree87c5f0f62675b901781839b29c8de73c506cd02d /llvm/lib/CodeGen/RegisterPressure.cpp
parent9b05d806329df11db7faf5aa7d9cc14a01021a34 (diff)
downloadbcm5719-llvm-3bf33075ce98e380fc0ba7aeb5928f1151019887.tar.gz
bcm5719-llvm-3bf33075ce98e380fc0ba7aeb5928f1151019887.zip
Use LiveRangeQuery for instruction-level liveness queries.
Remove redundant or bug-prone LiveInterval APIs. llvm-svn: 189685
Diffstat (limited to 'llvm/lib/CodeGen/RegisterPressure.cpp')
-rw-r--r--llvm/lib/CodeGen/RegisterPressure.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/RegisterPressure.cpp b/llvm/lib/CodeGen/RegisterPressure.cpp
index 1be203f36dd..27da370c961 100644
--- a/llvm/lib/CodeGen/RegisterPressure.cpp
+++ b/llvm/lib/CodeGen/RegisterPressure.cpp
@@ -500,8 +500,9 @@ bool RegPressureTracker::recede(SmallVectorImpl<unsigned> *LiveUses,
if (RequireIntervals) {
const LiveInterval *LI = getInterval(Reg);
// Check if this LR is killed and not redefined here.
- if (LI && !LI->isKilledAtInstr(SlotIdx)
- && !LI->isDefinedByInstr(SlotIdx)) {
+ if (LI) {
+ LiveRangeQuery LRQ(*LI, SlotIdx);
+ if (!LRQ.isKill() && !LRQ.valueDefined())
discoverLiveOut(Reg);
}
}
@@ -558,7 +559,7 @@ bool RegPressureTracker::advance() {
bool lastUse = false;
if (RequireIntervals) {
const LiveInterval *LI = getInterval(Reg);
- lastUse = LI && LI->isKilledAtInstr(SlotIdx);
+ lastUse = LI && LiveRangeQuery(*LI, SlotIdx).isKill();
}
else {
// Allocatable physregs are always single-use before register rewriting.
@@ -882,9 +883,10 @@ void RegPressureTracker::bumpDownwardPressure(const MachineInstr *MI) {
// to be bottom-scheduled to avoid searching uses at each query.
SlotIndex CurrIdx = getCurrSlot();
const LiveInterval *LI = getInterval(Reg);
- if (LI && LI->isKilledAtInstr(SlotIdx)
- && !findUseBetween(Reg, CurrIdx, SlotIdx, MRI, LIS)) {
- decreaseRegPressure(Reg);
+ if (LI) {
+ LiveRangeQuery LRQ(*LI, SlotIdx);
+ if (LRQ.isKill() && !findUseBetween(Reg, CurrIdx, SlotIdx, MRI, LIS))
+ decreaseRegPressure(Reg);
}
}
else if (!TargetRegisterInfo::isVirtualRegister(Reg)) {
OpenPOWER on IntegriCloud