summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2013-08-30 04:36:57 +0000
committerAndrew Trick <atrick@apple.com>2013-08-30 04:36:57 +0000
commit663bd9922776e5f7bc17dfc574efe3fe05ceb12c (patch)
tree2e827dbaff482f7d57d7b32d68735a42992846ff /include
parent1362dcb5899bc88f0e567dd10e2e9003a79ace21 (diff)
downloadllvm-663bd9922776e5f7bc17dfc574efe3fe05ceb12c.tar.gz
llvm-663bd9922776e5f7bc17dfc574efe3fe05ceb12c.tar.bz2
llvm-663bd9922776e5f7bc17dfc574efe3fe05ceb12c.tar.xz
mi-sched: update PressureDiffs on-the-fly for liveness.
This removes all expensive pressure tracking logic from the scheduling critical path of node comparison. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189643 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/LiveInterval.h6
-rw-r--r--include/llvm/CodeGen/MachineScheduler.h6
-rw-r--r--include/llvm/CodeGen/RegisterPressure.h2
3 files changed, 12 insertions, 2 deletions
diff --git a/include/llvm/CodeGen/LiveInterval.h b/include/llvm/CodeGen/LiveInterval.h
index 058f95e24e..38d07e4612 100644
--- a/include/llvm/CodeGen/LiveInterval.h
+++ b/include/llvm/CodeGen/LiveInterval.h
@@ -296,6 +296,12 @@ namespace llvm {
return r != end() && r->end.getBaseIndex() == BaseIdx;
}
+ /// Return true if a live range starts at the instruction at this index.
+ bool isDefinedByInstr(SlotIndex index) const {
+ const_iterator r = find(index.getDeadSlot());
+ return r != end() && r->end.getBaseIndex() == index.getBaseIndex();
+ }
+
/// getLiveRangeContaining - Return the live range that contains the
/// specified index, or null if there is none.
const LiveRange *getLiveRangeContaining(SlotIndex Idx) const {
diff --git a/include/llvm/CodeGen/MachineScheduler.h b/include/llvm/CodeGen/MachineScheduler.h
index 8f307f91a5..69c648c8c1 100644
--- a/include/llvm/CodeGen/MachineScheduler.h
+++ b/include/llvm/CodeGen/MachineScheduler.h
@@ -221,7 +221,9 @@ protected:
MachineBasicBlock::iterator LiveRegionEnd;
- // Map each SU to its summary of pressure changes.
+ // Map each SU to its summary of pressure changes. This array is updated for
+ // liveness during bottom-up scheduling. Top-down scheduling may proceed but
+ // has no affect on the pressure diffs.
PressureDiffs SUPressureDiffs;
/// Register pressure in this region computed by initRegPressure.
@@ -376,6 +378,8 @@ protected:
void initRegPressure();
+ void updatePressureDiffs(ArrayRef<unsigned> LiveUses);
+
void updateScheduledPressure(const std::vector<unsigned> &NewMaxPressure);
bool checkSchedLimit();
diff --git a/include/llvm/CodeGen/RegisterPressure.h b/include/llvm/CodeGen/RegisterPressure.h
index 68f2ac2349..e01e4ec216 100644
--- a/include/llvm/CodeGen/RegisterPressure.h
+++ b/include/llvm/CodeGen/RegisterPressure.h
@@ -311,7 +311,7 @@ public:
SlotIndex getCurrSlot() const;
/// Recede across the previous instruction.
- bool recede(PressureDiff *PDiff = 0);
+ bool recede(SmallVectorImpl<unsigned> *LiveUses = 0, PressureDiff *PDiff = 0);
/// Advance across the current instruction.
bool advance();