[llvm-commits] [llvm] r148172 - in /llvm/trunk/lib/CodeGen: MachineScheduler.cpp PostRASchedulerList.cpp ScheduleDAGInstrs.cpp ScheduleDAGInstrs.h
Andrew Trick
atrick at apple.com
Fri Jan 13 18:17:12 PST 2012
Author: atrick
Date: Fri Jan 13 20:17:12 2012
New Revision: 148172
URL: http://llvm.org/viewvc/llvm-project?rev=148172&view=rev
Log:
misched: Added ScheduleDAGInstrs::IsPostRA
Modified:
llvm/trunk/lib/CodeGen/MachineScheduler.cpp
llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp
llvm/trunk/lib/CodeGen/ScheduleDAGInstrs.cpp
llvm/trunk/lib/CodeGen/ScheduleDAGInstrs.h
Modified: llvm/trunk/lib/CodeGen/MachineScheduler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineScheduler.cpp?rev=148172&r1=148171&r2=148172&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineScheduler.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineScheduler.cpp Fri Jan 13 20:17:12 2012
@@ -157,7 +157,7 @@
MachineSchedulerPass *Pass;
public:
MachineScheduler(MachineSchedulerPass *P):
- ScheduleDAGInstrs(*P->MF, *P->MLI, *P->MDT), Pass(P) {}
+ ScheduleDAGInstrs(*P->MF, *P->MLI, *P->MDT, /*IsPostRA=*/false), Pass(P) {}
/// Schedule - This is called back from ScheduleDAGInstrs::Run() when it's
/// time to do some work.
@@ -252,7 +252,7 @@
MachineSchedulerPass *Pass;
public:
InstructionShuffler(MachineSchedulerPass *P):
- ScheduleDAGInstrs(*P->MF, *P->MLI, *P->MDT), Pass(P) {}
+ ScheduleDAGInstrs(*P->MF, *P->MLI, *P->MDT, /*IsPostRA=*/false), Pass(P) {}
/// Schedule - This is called back from ScheduleDAGInstrs::Run() when it's
/// time to do some work.
Modified: llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp?rev=148172&r1=148171&r2=148172&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp (original)
+++ llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp Fri Jan 13 20:17:12 2012
@@ -185,7 +185,7 @@
AliasAnalysis *AA, const RegisterClassInfo &RCI,
TargetSubtargetInfo::AntiDepBreakMode AntiDepMode,
SmallVectorImpl<TargetRegisterClass*> &CriticalPathRCs)
- : ScheduleDAGInstrs(MF, MLI, MDT), Topo(SUnits), AA(AA),
+ : ScheduleDAGInstrs(MF, MLI, MDT, /*IsPostRA=*/true), Topo(SUnits), AA(AA),
KillIndices(TRI->getNumRegs())
{
const TargetMachine &TM = MF.getTarget();
Modified: llvm/trunk/lib/CodeGen/ScheduleDAGInstrs.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ScheduleDAGInstrs.cpp?rev=148172&r1=148171&r2=148172&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/ScheduleDAGInstrs.cpp (original)
+++ llvm/trunk/lib/CodeGen/ScheduleDAGInstrs.cpp Fri Jan 13 20:17:12 2012
@@ -33,9 +33,10 @@
ScheduleDAGInstrs::ScheduleDAGInstrs(MachineFunction &mf,
const MachineLoopInfo &mli,
- const MachineDominatorTree &mdt)
+ const MachineDominatorTree &mdt,
+ bool IsPostRAFlag)
: ScheduleDAG(mf), MLI(mli), MDT(mdt), MFI(mf.getFrameInfo()),
- InstrItins(mf.getTarget().getInstrItineraryData()),
+ InstrItins(mf.getTarget().getInstrItineraryData()), IsPostRA(IsPostRAFlag),
Defs(TRI->getNumRegs()), Uses(TRI->getNumRegs()),
LoopRegs(MLI, MDT), FirstDbgValue(0) {
DbgValues.clear();
@@ -253,7 +254,8 @@
unsigned Reg = MO.getReg();
if (Reg == 0) continue;
- assert(TRI->isPhysicalRegister(Reg) && "Virtual register encountered!");
+ assert(!IsPostRA || TRI->isPhysicalRegister(Reg) &&
+ "Virtual register encountered!");
// Optionally add output and anti dependencies. For anti
// dependencies we use a latency of 0 because for a multi-issue
Modified: llvm/trunk/lib/CodeGen/ScheduleDAGInstrs.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ScheduleDAGInstrs.h?rev=148172&r1=148171&r2=148172&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/ScheduleDAGInstrs.h (original)
+++ llvm/trunk/lib/CodeGen/ScheduleDAGInstrs.h Fri Jan 13 20:17:12 2012
@@ -104,10 +104,13 @@
const MachineFrameInfo *MFI;
const InstrItineraryData *InstrItins;
- /// Defs, Uses - Remember where defs and uses of each physical register
- /// are as we iterate upward through the instructions. This is allocated
- /// here instead of inside BuildSchedGraph to avoid the need for it to be
- /// initialized and destructed for each block.
+ /// isPostRA flag indicates vregs cannot be present.
+ bool IsPostRA;
+
+ /// Defs, Uses - Remember where defs and uses of each register are as we
+ /// iterate upward through the instructions. This is allocated here instead
+ /// of inside BuildSchedGraph to avoid the need for it to be initialized and
+ /// destructed for each block.
std::vector<std::vector<SUnit *> > Defs;
std::vector<std::vector<SUnit *> > Uses;
@@ -136,7 +139,8 @@
explicit ScheduleDAGInstrs(MachineFunction &mf,
const MachineLoopInfo &mli,
- const MachineDominatorTree &mdt);
+ const MachineDominatorTree &mdt,
+ bool IsPostRAFlag);
virtual ~ScheduleDAGInstrs() {}
More information about the llvm-commits
mailing list