[PATCH] D96949: [FuncAttrs] Add willreturn to readonly callsites in mustprogress fns.
Johannes Doerfert via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 18 08:30:18 PST 2021
jdoerfert accepted this revision.
jdoerfert added inline comments.
This revision is now accepted and ready to land.
================
Comment at: llvm/lib/Transforms/IPO/FunctionAttrs.cpp:1449
+ bool Changed = false;
+ // Add willreturn to all callsites that only read memory.
+ for (Instruction &I : instructions(F)) {
----------------
The comment is confusing. If the caller is willreturn the call site behavior doesn't matter. If the caller is "only" mustprogress the call site behavior matters.
================
Comment at: llvm/lib/Transforms/IPO/FunctionAttrs.cpp:1464
+}
+
static bool functionWillReturn(const Function &F) {
----------------
You could track if any call was not willreturn to avoid doing so in `functionWillReturn`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D96949/new/
https://reviews.llvm.org/D96949
More information about the llvm-commits
mailing list