[PATCH] D17013: Add convergent-removing bits to FunctionAttrs pass.

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 9 13:34:02 PST 2016


jlebar marked an inline comment as done.

================
Comment at: lib/Transforms/IPO/FunctionAttrs.cpp:973
@@ +972,3 @@
+      return false;
+  }
+
----------------
joker.eph wrote:
> Suggestion: outline the loop body in a helper function `canRemoveConvergent(CallGraphNode *CGN)`
> 
> The loop becomes then: `if(!llvm::all_of(SCC, canRemoveConvergent)) return false;`
> 
> 
I'm actually not wild about this because it's a bit misleading.  Consider

  void foo() { bar(); }
  void bar() { __syncthreads(); foo(); }

canRemoveConvergent(foo) would return true, even though, because we cannot remove convergent from bar and foo and bar are in the same SCC, we cannot in fact remove convergent from foo.


http://reviews.llvm.org/D17013





More information about the llvm-commits mailing list