/// Add the complete, standard set of LLVM CodeGen passes.
/// Fully developed targets will not generally override this.
virtual void addMachinePasses();
+
protected:
// Helper to verify the analysis is really immutable.
void setOpt(bool &Opt, bool Val);
/// createMachineLICMPass - This pass performs LICM on machine instructions.
///
- FunctionPass *createMachineLICMPass(bool PreRegAlloc = true);
+ FunctionPass *createMachineLICMPass();
/// createMachineSinkingPass - This pass performs sinking on machine
/// instructions.
namespace {
class MachineLICM : public MachineFunctionPass {
- bool PreRegAlloc;
-
const TargetMachine *TM;
const TargetInstrInfo *TII;
const TargetLowering *TLI;
const MachineFrameInfo *MFI;
MachineRegisterInfo *MRI;
const InstrItineraryData *InstrItins;
+ bool PreRegAlloc;
// Various analyses that we use...
AliasAnalysis *AA; // Alias analysis info.
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
MRI = &MF.getRegInfo();
InstrItins = TM->getInstrItineraryData();
+ PreRegAlloc = MRI->isSSA();
+
if (PreRegAlloc) {
// Estimate register pressure during pre-regalloc pass.
unsigned NumRC = TRI->getNumRegClasses();
// 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");
}