[PATCH] D138336: [AA] A global cannot escape through nocapture/nocallback call.
Johannes Doerfert via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 18 16:47:16 PST 2022
jdoerfert added a comment.
I like the idea. The tests should be augmented though. First, run sroa on the test, there is no need for such verbose IR.
Then, add a second version for all of them that calls an unknown function in the loop. As written, I can always hoist all of them, even if we don't do it yet.
I would personally use the check line script but I guess that one can check it like this too.
================
Comment at: llvm/lib/Analysis/GlobalsModRef.cpp:367
+ !Call->doesNotCapture(Call->getArgOperandNo(&U)))
+ return true;
+
----------------
Usually we check the call for attributes, not the function.
================
Comment at: llvm/test/Analysis/GlobalsModRef/noescape-nocapture-nocallback.ll:4
+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
----------------
No tripple needed.
================
Comment at: llvm/test/Analysis/GlobalsModRef/noescape-nocapture-nocallback.ll:152
+
+attributes #0 = { nocallback }
----------------
Maybe write it inline, easier to read.
`declare ... nocallback`
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D138336/new/
https://reviews.llvm.org/D138336
More information about the llvm-commits
mailing list