[llvm] [BasicAA] Treat returns_twice functions as clobbering unescaped objects (PR #117902)
Antonio Frighetto via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 6 10:01:35 PDT 2025
antoniofrighetto wrote:
@nikic Sorry for getting back again into this. I moved to using EarliestEscapeAnalysis::getCapturesBefore() and moved the returns_twice check close to the caller (in GVN). However, I'm still not clear.
If getCapturesBefore() is passed with OrAt true, and the instruction which may capture the object (thus, instruction itself included) is our setjmp, then shouldn't we expect the routine to say the provenance of the underlying object (a noalias malloc ptr in this case, as per the test in the PR) may be captured by the setjmp? (For this instance, we say CaptureComponents::None). If that happens to be the case, should returns_twice be taken into account within IsNotCapturedBefore lambda?
Anyway, perhaps this discussion should be held in the code review of the MemSSA main patch.
https://github.com/llvm/llvm-project/pull/117902
More information about the llvm-commits
mailing list