diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2013-01-17 00:58:38 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2013-01-17 00:58:38 +0000 |
commit | 02c6325a4592fefebc837b677eaf87dc532ecb7c (patch) | |
tree | a5e447051368b3abd09d3a806a30b1b415b61275 /lib/Target/X86/X86TargetMachine.cpp | |
parent | c147b678206db510336ee95c3b55dc9c0ff19595 (diff) | |
download | llvm-02c6325a4592fefebc837b677eaf87dc532ecb7c.tar.gz llvm-02c6325a4592fefebc837b677eaf87dc532ecb7c.tar.bz2 llvm-02c6325a4592fefebc837b677eaf87dc532ecb7c.tar.xz |
Provide a place for targets to insert ILP optimization passes.
Move the early if-conversion pass into this group.
ILP optimizations usually need to find the right balance between
register pressure and ILP using the MachineTraceMetrics analysis to
identify critical paths and estimate other costs. Such passes should run
together so they can share dominator tree and loop info analyses.
Besides if-conversion, future passes to run here here could include
expression height reduction and ARM's MLxExpansion pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172687 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86TargetMachine.cpp')
-rw-r--r-- | lib/Target/X86/X86TargetMachine.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/Target/X86/X86TargetMachine.cpp b/lib/Target/X86/X86TargetMachine.cpp index 706e64a09f..799f140407 100644 --- a/lib/Target/X86/X86TargetMachine.cpp +++ b/lib/Target/X86/X86TargetMachine.cpp @@ -151,6 +151,7 @@ public: } virtual bool addInstSelector(); + virtual bool addILPOpts(); virtual bool addPreRegAlloc(); virtual bool addPostRegAlloc(); virtual bool addPreEmitPass(); @@ -158,12 +159,7 @@ public: } // namespace TargetPassConfig *X86TargetMachine::createPassConfig(PassManagerBase &PM) { - X86PassConfig *PC = new X86PassConfig(this, PM); - - if (X86EarlyIfConv && Subtarget.hasCMov()) - PC->enablePass(&EarlyIfConverterID); - - return PC; + return new X86PassConfig(this, PM); } bool X86PassConfig::addInstSelector() { @@ -181,6 +177,14 @@ bool X86PassConfig::addInstSelector() { return false; } +bool X86PassConfig::addILPOpts() { + if (X86EarlyIfConv && getX86Subtarget().hasCMov()) { + addPass(&EarlyIfConverterID); + return true; + } + return false; +} + bool X86PassConfig::addPreRegAlloc() { return false; // -print-machineinstr shouldn't print after this. } |