[PATCH] D21143: Include SelectionDAGISel in the opt-bisect process

Andy Kaylor via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 8 10:43:19 PDT 2016


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

This patch allows the SelectionDAGISel pass to be put into CodeGenOpt::None mode in response to the opt-bisect-limit command line option in addition to the OptimizeNone function attribute (the skipFunction() call checks both of these conditions).

See D19172 for details on the opt-bisect implementation.

I am checking to see if the optimization level is already CodeGenOpt::None before calling the skipFunction() method in order to avoid introducing test failures in two lit tests which verify that no pass is "skipped" by the optnone or opt-bisect options that is otherwise run at -O0.  Calling skipFunction at -O0 wouldn't actually change this pass' behavior, but it would generate a debugging message indicating that the pass was being skipped.

Repository:
  rL LLVM

http://reviews.llvm.org/D21143

Files:
  lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

Index: lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
===================================================================
--- lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -444,7 +444,7 @@
   TM.resetTargetOptions(Fn);
   // Reset OptLevel to None for optnone functions.
   CodeGenOpt::Level NewOptLevel = OptLevel;
-  if (Fn.hasFnAttribute(Attribute::OptimizeNone))
+  if (OptLevel != CodeGenOpt::None && skipFunction(Fn))
     NewOptLevel = CodeGenOpt::None;
   OptLevelChanger OLC(*this, NewOptLevel);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21143.60067.patch
Type: text/x-patch
Size: 559 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160608/05196f92/attachment.bin>


More information about the llvm-commits mailing list