[PATCH] D138336: [AA] A global cannot escape through nocapture/nocallback call.

Slava Zakharin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 20 17:14:44 PST 2022


vzakhari added a comment.

> We could even do better in the nocapture case w/o nocallback, maybe add a TODO as this case can be handled if all uses in the module are nocapture effectively.

Good point.  I will add a note.



================
Comment at: llvm/test/Analysis/GlobalsModRef/noescape-nocapture-nocallback.ll:66
+  %arrayidx = getelementptr inbounds ptr, ptr %0, i64 %idxprom
+  store ptr %p, ptr %arrayidx, align 8
+  br label %for.inc
----------------
Johannes, I have hard time figuring out why this code may be optimized without the capture analysis.

Doesn't this store conflict with the above load, in general?  I think it can, if somewhere inside the module I do `obj0.p = obj0`.  So the capture analysis is required to prove that they do not conflict.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138336/new/

https://reviews.llvm.org/D138336



More information about the llvm-commits mailing list