mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
misched: DAG builder support for tracking register pressure within the current scheduling region.
The DAG builder is a convenient place to do it. Hopefully this is more efficient than a separate traversal over the same region. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155456 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#define DEBUG_TYPE "sched-instrs"
|
||||
#include "RegisterPressure.h"
|
||||
#include "llvm/Operator.h"
|
||||
#include "llvm/Analysis/AliasAnalysis.h"
|
||||
#include "llvm/Analysis/ValueTracking.h"
|
||||
@@ -504,7 +505,11 @@ void ScheduleDAGInstrs::initSUnits() {
|
||||
}
|
||||
}
|
||||
|
||||
void ScheduleDAGInstrs::buildSchedGraph(AliasAnalysis *AA) {
|
||||
/// If RegPressure is non null, compute register pressure as a side effect. The
|
||||
/// DAG builder is an efficient place to do it because it already visits
|
||||
/// operands.
|
||||
void ScheduleDAGInstrs::buildSchedGraph(AliasAnalysis *AA,
|
||||
RegPressureTracker *RPTracker) {
|
||||
// Create an SUnit for each real instruction.
|
||||
initSUnits();
|
||||
|
||||
@@ -555,6 +560,10 @@ void ScheduleDAGInstrs::buildSchedGraph(AliasAnalysis *AA) {
|
||||
PrevMI = MI;
|
||||
continue;
|
||||
}
|
||||
if (RPTracker) {
|
||||
RPTracker->recede();
|
||||
assert(RPTracker->getPos() == prior(MII) && "RPTracker can't find MI");
|
||||
}
|
||||
|
||||
assert((!MI->isTerminator() || CanHandleTerminators) && !MI->isLabel() &&
|
||||
"Cannot schedule terminators or labels!");
|
||||
|
||||
Reference in New Issue
Block a user