[PATCH] D19562: Add optimization bisect opt-in calls for SystemZ passes

Andy Kaylor via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 26 14:58:43 PDT 2016


andrew.w.kaylor created this revision.
andrew.w.kaylor added a reviewer: uweigand.
andrew.w.kaylor added a subscriber: llvm-commits.
andrew.w.kaylor set the repository for this revision to rL LLVM.

This patch adds calls to SystemZ-specific passes that can be safely skipped to opt-in to the optimization bisect mechanism.

I selected the passes to be skipped based on the fact that they were not added at CodeGenOpt::None in SystemZTargetMachine.cpp. Based on that criteria, I did not add opt-in calls to the SystemZLongBranch pass, which appear to be required.

Note that the call to skipFunction() will also check for the "optnone" function attribute, so this can theoretically result in passes being skipped even when optimization bisect is not being done. However, I believe that any pass that can be safely skipped should be skipped for functions with the optnone attribute.

See D19172 for details on the base optimizaton bisect implementation.

Repository:
  rL LLVM

http://reviews.llvm.org/D19562

Files:
  lib/Target/SystemZ/SystemZElimCompare.cpp
  lib/Target/SystemZ/SystemZLDCleanup.cpp
  lib/Target/SystemZ/SystemZShortenInst.cpp

Index: lib/Target/SystemZ/SystemZElimCompare.cpp
===================================================================
--- lib/Target/SystemZ/SystemZElimCompare.cpp
+++ lib/Target/SystemZ/SystemZElimCompare.cpp
@@ -500,6 +500,9 @@
 }
 
 bool SystemZElimCompare::runOnMachineFunction(MachineFunction &F) {
+  if (skipFunction(*F.getFunction()))
+    return false;
+
   TII = static_cast<const SystemZInstrInfo *>(F.getSubtarget().getInstrInfo());
   TRI = &TII->getRegisterInfo();
 
Index: lib/Target/SystemZ/SystemZShortenInst.cpp
===================================================================
--- lib/Target/SystemZ/SystemZShortenInst.cpp
+++ lib/Target/SystemZ/SystemZShortenInst.cpp
@@ -268,6 +268,9 @@
 }
 
 bool SystemZShortenInst::runOnMachineFunction(MachineFunction &F) {
+  if (skipFunction(*F.getFunction()))
+    return false;
+
   const SystemZSubtarget &ST = F.getSubtarget<SystemZSubtarget>();
   TII = ST.getInstrInfo();
   TRI = ST.getRegisterInfo();
Index: lib/Target/SystemZ/SystemZLDCleanup.cpp
===================================================================
--- lib/Target/SystemZ/SystemZLDCleanup.cpp
+++ lib/Target/SystemZ/SystemZLDCleanup.cpp
@@ -64,6 +64,9 @@
 }
 
 bool SystemZLDCleanup::runOnMachineFunction(MachineFunction &F) {
+  if (skipFunction(*F.getFunction()))
+    return false;
+
   TII = static_cast<const SystemZInstrInfo *>(F.getSubtarget().getInstrInfo());
   MF = &F;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19562.55102.patch
Type: text/x-patch
Size: 1418 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160426/4e68cf29/attachment.bin>


More information about the llvm-commits mailing list