diff options
author | Andrew Kaylor <andrew.kaylor@intel.com> | 2016-04-26 21:44:24 +0000 |
---|---|---|
committer | Andrew Kaylor <andrew.kaylor@intel.com> | 2016-04-26 21:44:24 +0000 |
commit | 2bee5ef462d1ffefeb17c150b2e43e15a39e4cf5 (patch) | |
tree | a20bae80d996a52dadef8222a982b18c9d32934e /llvm/lib/Target | |
parent | 128f8732a5c4c318ae8e789754857aea278be8a6 (diff) | |
download | bcm5719-llvm-2bee5ef462d1ffefeb17c150b2e43e15a39e4cf5.tar.gz bcm5719-llvm-2bee5ef462d1ffefeb17c150b2e43e15a39e4cf5.zip |
Optimization bisect support in X86-specific passes
Differential Revision: http://reviews.llvm.org/D19439
llvm-svn: 267608
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r-- | llvm/lib/Target/X86/X86FixupBWInsts.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/Target/X86/X86FixupLEAs.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/Target/X86/X86InstrInfo.cpp | 5 | ||||
-rw-r--r-- | llvm/lib/Target/X86/X86OptimizeLEAs.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/Target/X86/X86PadShortFunction.cpp | 3 |
5 files changed, 13 insertions, 3 deletions
diff --git a/llvm/lib/Target/X86/X86FixupBWInsts.cpp b/llvm/lib/Target/X86/X86FixupBWInsts.cpp index 8b212127881..52037692185 100644 --- a/llvm/lib/Target/X86/X86FixupBWInsts.cpp +++ b/llvm/lib/Target/X86/X86FixupBWInsts.cpp @@ -138,7 +138,7 @@ char FixupBWInstPass::ID = 0; FunctionPass *llvm::createX86FixupBWInsts() { return new FixupBWInstPass(); } bool FixupBWInstPass::runOnMachineFunction(MachineFunction &MF) { - if (!FixupBWInsts) + if (!FixupBWInsts || skipFunction(*MF.getFunction())) return false; this->MF = &MF; diff --git a/llvm/lib/Target/X86/X86FixupLEAs.cpp b/llvm/lib/Target/X86/X86FixupLEAs.cpp index dc8f6d5f0bc..5af91de5a11 100644 --- a/llvm/lib/Target/X86/X86FixupLEAs.cpp +++ b/llvm/lib/Target/X86/X86FixupLEAs.cpp @@ -162,6 +162,9 @@ FixupLEAPass::postRAConvertToLEA(MachineFunction::iterator &MFI, FunctionPass *llvm::createX86FixupLEAs() { return new FixupLEAPass(); } bool FixupLEAPass::runOnMachineFunction(MachineFunction &Func) { + if (skipFunction(*Func.getFunction())) + return false; + MF = &Func; const X86Subtarget &ST = Func.getSubtarget<X86Subtarget>(); OptIncDec = !ST.slowIncDec() || Func.getFunction()->optForMinSize(); diff --git a/llvm/lib/Target/X86/X86InstrInfo.cpp b/llvm/lib/Target/X86/X86InstrInfo.cpp index b0b8c59689e..088188566b3 100644 --- a/llvm/lib/Target/X86/X86InstrInfo.cpp +++ b/llvm/lib/Target/X86/X86InstrInfo.cpp @@ -7377,7 +7377,10 @@ namespace { LDTLSCleanup() : MachineFunctionPass(ID) {} bool runOnMachineFunction(MachineFunction &MF) override { - X86MachineFunctionInfo* MFI = MF.getInfo<X86MachineFunctionInfo>(); + if (skipFunction(*MF.getFunction())) + return false; + + X86MachineFunctionInfo *MFI = MF.getInfo<X86MachineFunctionInfo>(); if (MFI->getNumLocalDynamicTLSAccesses() < 2) { // No point folding accesses if there isn't at least two. return false; diff --git a/llvm/lib/Target/X86/X86OptimizeLEAs.cpp b/llvm/lib/Target/X86/X86OptimizeLEAs.cpp index 3c83f5d64dc..2ec9941bc4a 100644 --- a/llvm/lib/Target/X86/X86OptimizeLEAs.cpp +++ b/llvm/lib/Target/X86/X86OptimizeLEAs.cpp @@ -616,7 +616,8 @@ bool OptimizeLEAPass::runOnMachineFunction(MachineFunction &MF) { bool Changed = false; // Perform this optimization only if we care about code size. - if (DisableX86LEAOpt || !MF.getFunction()->optForSize()) + if (DisableX86LEAOpt || skipFunction(*MF.getFunction()) || + !MF.getFunction()->optForSize()) return false; MRI = &MF.getRegInfo(); diff --git a/llvm/lib/Target/X86/X86PadShortFunction.cpp b/llvm/lib/Target/X86/X86PadShortFunction.cpp index 96e8b9b274d..18068485876 100644 --- a/llvm/lib/Target/X86/X86PadShortFunction.cpp +++ b/llvm/lib/Target/X86/X86PadShortFunction.cpp @@ -98,6 +98,9 @@ FunctionPass *llvm::createX86PadShortFunctions() { /// runOnMachineFunction - Loop over all of the basic blocks, inserting /// NOOP instructions before early exits. bool PadShortFunc::runOnMachineFunction(MachineFunction &MF) { + if (skipFunction(*MF.getFunction())) + return false; + if (MF.getFunction()->optForSize()) { return false; } |