Skip to content

Instantly share code, notes, and snippets.

/-

Created February 22, 2016 19:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/57285538454829420e0e to your computer and use it in GitHub Desktop.
Save anonymous/57285538454829420e0e to your computer and use it in GitHub Desktop.
diff --git a/lib/Transforms/IPO/FunctionAttrs.cpp b/lib/Transforms/IPO/FunctionAttrs.cpp
index 2eec438..a1c245f 100644
--- a/lib/Transforms/IPO/FunctionAttrs.cpp
+++ b/lib/Transforms/IPO/FunctionAttrs.cpp
@@ -943,12 +943,15 @@ static bool removeConvergentAttrs(const SCCNodeSet &SCCNodes) {
// If we got here, all of the SCC's callees are non-convergent. Therefore all
// of the SCC's functions can be marked as non-convergent.
+ bool MadeChange = false;
for (Function *F : SCCNodes) {
- if (F->isConvergent())
+ if (F->isConvergent()) {
+ MadeChange = true;
DEBUG(dbgs() << "Removing convergent attr from " << F->getName() << "\n");
+ }
F->setNotConvergent();
}
- return true;
+ return MadeChange;
}
static bool setDoesNotRecurse(Function &F) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment