[PATCH] D19439: Optimization bisect support in X86-specific passes

Andy Kaylor via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 26 10:45:13 PDT 2016


andrew.w.kaylor updated this revision to Diff 55039.
andrew.w.kaylor added a comment.

Removed skip calls from passes that are run at -O0
Moved skip checks behind other single variable conditions


Repository:
  rL LLVM

http://reviews.llvm.org/D19439

Files:
  lib/Target/X86/X86FixupBWInsts.cpp
  lib/Target/X86/X86FixupLEAs.cpp
  lib/Target/X86/X86InstrInfo.cpp
  lib/Target/X86/X86OptimizeLEAs.cpp
  lib/Target/X86/X86PadShortFunction.cpp

Index: lib/Target/X86/X86FixupBWInsts.cpp
===================================================================
--- lib/Target/X86/X86FixupBWInsts.cpp
+++ lib/Target/X86/X86FixupBWInsts.cpp
@@ -135,7 +135,7 @@
 FunctionPass *llvm::createX86FixupBWInsts() { return new FixupBWInstPass(); }
 
 bool FixupBWInstPass::runOnMachineFunction(MachineFunction &MF) {
-  if (!FixupBWInsts)
+  if (!FixupBWInsts || skipFunction(*MF.getFunction()))
     return false;
 
   this->MF = &MF;
Index: lib/Target/X86/X86PadShortFunction.cpp
===================================================================
--- lib/Target/X86/X86PadShortFunction.cpp
+++ lib/Target/X86/X86PadShortFunction.cpp
@@ -98,6 +98,9 @@
 /// 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;
   }
Index: lib/Target/X86/X86InstrInfo.cpp
===================================================================
--- lib/Target/X86/X86InstrInfo.cpp
+++ lib/Target/X86/X86InstrInfo.cpp
@@ -7377,7 +7377,10 @@
     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;
Index: lib/Target/X86/X86OptimizeLEAs.cpp
===================================================================
--- lib/Target/X86/X86OptimizeLEAs.cpp
+++ lib/Target/X86/X86OptimizeLEAs.cpp
@@ -612,7 +612,8 @@
   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();
Index: lib/Target/X86/X86FixupLEAs.cpp
===================================================================
--- lib/Target/X86/X86FixupLEAs.cpp
+++ lib/Target/X86/X86FixupLEAs.cpp
@@ -162,6 +162,9 @@
 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();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19439.55039.patch
Type: text/x-patch
Size: 2742 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160426/6940abbf/attachment.bin>


More information about the llvm-commits mailing list