[PATCH] D96949: [FuncAttrs] Add willreturn to readonly callsites in mustprogress fns.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 18 09:17:07 PST 2021


fhahn marked an inline comment as done.
fhahn added inline comments.


================
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)) {
----------------
jdoerfert wrote:
> 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.
updated


================
Comment at: llvm/lib/Transforms/IPO/FunctionAttrs.cpp:1464
+}
+
 static bool functionWillReturn(const Function &F) {
----------------
jdoerfert wrote:
> You could track if any call was not willreturn to avoid doing so in `functionWillReturn`.
I updated the code but due to the early exit I think we need to track the possibility that we did not analyze the call sites, so unfortunately it's a bit more complicated.


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