[PATCH] D17013: Add convergent-removing bits to FunctionAttrs pass.
Jingyue Wu via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 8 19:26:43 PST 2016
jingyue added inline comments.
================
Comment at: lib/Transforms/IPO/FunctionAttrs.cpp:934
@@ +933,3 @@
+/// Remove convergent attributes where we can prove that none of our callees are
+/// themselves convergent.
+static bool removeConvergentAttrs(const CallGraphSCC &SCC) {
----------------
Please comment on what it returns.
================
Comment at: lib/Transforms/IPO/FunctionAttrs.cpp:936
@@ +935,3 @@
+static bool removeConvergentAttrs(const CallGraphSCC &SCC) {
+ const CallGraphNode *CGN = *SCC.begin();
+ Function *F = CGN->getFunction();
----------------
`SCC` may contain multiple functions. In that case, you need to consider all of them.
================
Comment at: lib/Transforms/IPO/FunctionAttrs.cpp:949
@@ +948,3 @@
+ // body looking for those.
+ for (auto &BB : *F)
+ for (auto &I : BB) {
----------------
You can iterate through the call sites with `CallGraphNode::iterator` (http://llvm.org/docs/doxygen/html/CallGraph_8h_source.html#l00186).
http://reviews.llvm.org/D17013
More information about the llvm-commits
mailing list