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

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 8 18:39:38 PST 2016


joker.eph added inline comments.

================
Comment at: lib/Transforms/IPO/FunctionAttrs.cpp:950
@@ +949,3 @@
+  for (auto &BB : *F)
+    for (auto &I : BB) {
+      CallSite CS(cast<Value>(&I));
----------------
could also by a call to `any_of`?

================
Comment at: lib/Transforms/IPO/FunctionAttrs.cpp:954
@@ +953,3 @@
+      Function *Callee = CS.getCalledFunction();
+      if (Callee && Callee->isIntrinsic() && Callee->isConvergent())
+        return false;
----------------
`Callee->isIntrinsic()` should be redundant here (I mean `!Callee->isIntrinsic() && Callee->isConvergent()` should be impossible after the `llvm::any_of` loop above right?


http://reviews.llvm.org/D17013





More information about the llvm-commits mailing list