mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 21:29:20 +00:00
Move option to enable machine LICM into LLVMTargetMachine.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45572 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b082c6f5d9
commit
cc8f603f53
@ -33,7 +33,10 @@ static cl::opt<bool> PrintEmittedAsm("print-emitted-asm", cl::Hidden,
|
|||||||
static cl::opt<bool>
|
static cl::opt<bool>
|
||||||
EnableSinking("enable-sinking", cl::init(false), cl::Hidden,
|
EnableSinking("enable-sinking", cl::init(false), cl::Hidden,
|
||||||
cl::desc("Perform sinking on machine code"));
|
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
|
FileModel::Model
|
||||||
LLVMTargetMachine::addPassesToEmitFile(FunctionPassManager &PM,
|
LLVMTargetMachine::addPassesToEmitFile(FunctionPassManager &PM,
|
||||||
@ -73,7 +76,8 @@ LLVMTargetMachine::addPassesToEmitFile(FunctionPassManager &PM,
|
|||||||
if (PrintMachineCode)
|
if (PrintMachineCode)
|
||||||
PM.add(createMachineFunctionPrinterPass(cerr));
|
PM.add(createMachineFunctionPrinterPass(cerr));
|
||||||
|
|
||||||
PM.add(createMachineLICMPass());
|
if (PerformLICM)
|
||||||
|
PM.add(createMachineLICMPass());
|
||||||
|
|
||||||
if (EnableSinking)
|
if (EnableSinking)
|
||||||
PM.add(createMachineSinkingPass());
|
PM.add(createMachineSinkingPass());
|
||||||
@ -187,7 +191,8 @@ bool LLVMTargetMachine::addPassesToEmitMachineCode(FunctionPassManager &PM,
|
|||||||
if (PrintMachineCode)
|
if (PrintMachineCode)
|
||||||
PM.add(createMachineFunctionPrinterPass(cerr));
|
PM.add(createMachineFunctionPrinterPass(cerr));
|
||||||
|
|
||||||
PM.add(createMachineLICMPass());
|
if (PerformLICM)
|
||||||
|
PM.add(createMachineLICMPass());
|
||||||
|
|
||||||
// Perform register allocation to convert to a concrete x86 representation
|
// Perform register allocation to convert to a concrete x86 representation
|
||||||
PM.add(createRegisterAllocator());
|
PM.add(createRegisterAllocator());
|
||||||
|
@ -28,14 +28,6 @@
|
|||||||
|
|
||||||
using namespace llvm;
|
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");
|
STATISTIC(NumHoisted, "Number of machine instructions hoisted out of loops");
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@ -167,8 +159,6 @@ FunctionPass *llvm::createMachineLICMPass() { return new MachineLICM(); }
|
|||||||
/// loop.
|
/// loop.
|
||||||
///
|
///
|
||||||
bool MachineLICM::runOnMachineFunction(MachineFunction &MF) {
|
bool MachineLICM::runOnMachineFunction(MachineFunction &MF) {
|
||||||
if (!PerformLICM) return false; // For debugging.
|
|
||||||
|
|
||||||
DOUT << "******** Machine LICM ********\n";
|
DOUT << "******** Machine LICM ********\n";
|
||||||
|
|
||||||
Changed = false;
|
Changed = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user