diff options
author | Andrew Trick <atrick@apple.com> | 2012-02-08 21:23:03 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2012-02-08 21:23:03 +0000 |
commit | c40815de62286ee6e324cb0a342db85e0a5a3c23 (patch) | |
tree | c1d9b24ba1472feec96bf2603455f982214333fe /llvm/lib | |
parent | 5209c739cd00e89e8bf323fd54adbf168500277b (diff) | |
download | bcm5719-llvm-c40815de62286ee6e324cb0a342db85e0a5a3c23.tar.gz bcm5719-llvm-c40815de62286ee6e324cb0a342db85e0a5a3c23.zip |
Move pass configuration out of pass constructors: MachineLICM.
llvm-svn: 150099
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/MachineLICM.cpp | 9 | ||||
-rw-r--r-- | llvm/lib/CodeGen/Passes.cpp | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/MachineLICM.cpp b/llvm/lib/CodeGen/MachineLICM.cpp index 7c07ac4a24b..bf6185a7ea7 100644 --- a/llvm/lib/CodeGen/MachineLICM.cpp +++ b/llvm/lib/CodeGen/MachineLICM.cpp @@ -60,8 +60,6 @@ STATISTIC(NumPostRAHoisted, namespace { class MachineLICM : public MachineFunctionPass { - bool PreRegAlloc; - const TargetMachine *TM; const TargetInstrInfo *TII; const TargetLowering *TLI; @@ -69,6 +67,7 @@ namespace { const MachineFrameInfo *MFI; MachineRegisterInfo *MRI; const InstrItineraryData *InstrItins; + bool PreRegAlloc; // Various analyses that we use... AliasAnalysis *AA; // Alias analysis info. @@ -298,8 +297,8 @@ INITIALIZE_AG_DEPENDENCY(AliasAnalysis) INITIALIZE_PASS_END(MachineLICM, "machinelicm", "Machine Loop Invariant Code Motion", false, false) -FunctionPass *llvm::createMachineLICMPass(bool PreRegAlloc) { - return new MachineLICM(PreRegAlloc); +FunctionPass *llvm::createMachineLICMPass() { + return new MachineLICM(); } /// LoopIsOuterMostWithPredecessor - Test if the given loop is the outer-most @@ -332,6 +331,8 @@ bool MachineLICM::runOnMachineFunction(MachineFunction &MF) { MRI = &MF.getRegInfo(); InstrItins = TM->getInstrItineraryData(); + PreRegAlloc = MRI->isSSA(); + if (PreRegAlloc) { // Estimate register pressure during pre-regalloc pass. unsigned NumRC = TRI->getNumRegClasses(); diff --git a/llvm/lib/CodeGen/Passes.cpp b/llvm/lib/CodeGen/Passes.cpp index 01662743afe..354fedbef9a 100644 --- a/llvm/lib/CodeGen/Passes.cpp +++ b/llvm/lib/CodeGen/Passes.cpp @@ -244,7 +244,7 @@ void TargetPassConfig::addMachinePasses() { // Run post-ra machine LICM to hoist reloads / remats. if (!DisablePostRAMachineLICM) - PM.add(createMachineLICMPass(false)); + PM.add(createMachineLICMPass()); printAndVerify("After StackSlotColoring and postra Machine LICM"); } |