[PATCH] D19882: Add opt-bisect support to additional passes that can be skipped

Andy Kaylor via llvm-commits llvm-commits at lists.llvm.org
Tue May 3 14:38:35 PDT 2016


andrew.w.kaylor added inline comments.

================
Comment at: lib/Transforms/Scalar/Reg2Mem.cpp:71
@@ -70,3 +70,3 @@
 bool RegToMem::runOnFunction(Function &F) {
-  if (F.isDeclaration())
+  if (F.isDeclaration() || skipFunction(F))
     return false;
----------------
probinson wrote:
> Not something for you to fix, but this just looks weird.  We run passes on functions that are just declarations?
I think you're right.  That shouldn't happen.  Declarations get filtered out in the FPPassManager.  Perhaps this is an artifact from some previous implementation?

I'll make a note to look into that as a separate change.

================
Comment at: lib/Transforms/Scalar/SimplifyCFGPass.cpp:212
@@ -211,3 +211,3 @@
   bool runOnFunction(Function &F) override {
-    if (PredicateFtor && !PredicateFtor(F))
+    if (skipFunction(F) || (PredicateFtor && !PredicateFtor(F)))
       return false;
----------------
probinson wrote:
> This one already calls skipFunction, just below. If you want to combine the conditions, for consistency with other passes, you should remove the other call.
Oops.  I clean that up.

================
Comment at: test/Other/opt-bisect-legacy-pass-manager.ll:142
@@ -139,4 +141,3 @@
 entry:
-  %temp = call i32 @g()
-  %icmp = icmp ugt i32 %temp, 2
+  %icmp = icmp ugt i32 undef, 2
   br i1 %icmp, label %bb.true, label %bb.false
----------------
probinson wrote:
> It's not clear why you want to remove the call to function g.  If this is in response to a review comment from a different review, that cleanup should be done independently as its own commit.
I took it out for AMDGPU.  The AMDGPU targets don't allow call instructions, but they can't inline a call to an external function so this was just failing.  I can move this change to the AMDGPU-specific patch since I'm marking the test as XFAIL for those platforms here anyway.


Repository:
  rL LLVM

http://reviews.llvm.org/D19882





More information about the llvm-commits mailing list