static cl::opt<bool>
EnableSinking("enable-sinking", cl::init(false), cl::Hidden,
cl::desc("Perform sinking on machine code"));
-
+static cl::opt<bool>
+PerformLICM("machine-licm",
+ cl::init(false), cl::Hidden,
+ cl::desc("Perform loop-invariant code motion on machine code"));
FileModel::Model
LLVMTargetMachine::addPassesToEmitFile(FunctionPassManager &PM,
if (PrintMachineCode)
PM.add(createMachineFunctionPrinterPass(cerr));
- PM.add(createMachineLICMPass());
+ if (PerformLICM)
+ PM.add(createMachineLICMPass());
if (EnableSinking)
PM.add(createMachineSinkingPass());
if (PrintMachineCode)
PM.add(createMachineFunctionPrinterPass(cerr));
- PM.add(createMachineLICMPass());
+ if (PerformLICM)
+ PM.add(createMachineLICMPass());
// Perform register allocation to convert to a concrete x86 representation
PM.add(createRegisterAllocator());
using namespace llvm;
-namespace {
- // Hidden options to help debugging
- cl::opt<bool>
- PerformLICM("machine-licm",
- cl::init(false), cl::Hidden,
- cl::desc("Perform loop-invariant code motion on machine code"));
-}
-
STATISTIC(NumHoisted, "Number of machine instructions hoisted out of loops");
namespace {
/// loop.
///
bool MachineLICM::runOnMachineFunction(MachineFunction &MF) {
- if (!PerformLICM) return false; // For debugging.
-
DOUT << "******** Machine LICM ********\n";
Changed = false;