[PATCH] D94502: [FunctionAttrs] Derive willreturn for fns with readonly` & `mustprogress`.
Johannes Doerfert via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 12 08:48:16 PST 2021
jdoerfert accepted this revision.
jdoerfert added a comment.
This revision is now accepted and ready to land.
I left some comments that need to be addressed, not necessarily how I proposed it but somehow. LGTM otherwise.
================
Comment at: llvm/lib/Transforms/IPO/FunctionAttrs.cpp:1433
+ if (!F || !F->onlyReadsMemory() || !F->mustProgress())
+ continue;
+
----------------
`|| F->hasFnAttr(Attribute::WillReturn)`
================
Comment at: llvm/lib/Transforms/IPO/FunctionAttrs.cpp:1436
+ F->addFnAttr(Attribute::WillReturn);
+ F->removeFnAttr(Attribute::NoReturn);
+ }
----------------
`Changed = true;` ;)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D94502/new/
https://reviews.llvm.org/D94502
More information about the llvm-commits
mailing list