[llvm] [FunctionAttrs] Switch readonly etc inference to use CaptureTracking (PR #201136)
Antonio Frighetto via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 3 02:50:29 PDT 2026
================
@@ -480,7 +480,7 @@ define void @memcpy(ptr %p, ptr %p2) {
define void @memcpy_volatile(ptr %p, ptr %p2) {
; CHECK: Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite, inaccessiblemem: readwrite)
; CHECK-LABEL: define void @memcpy_volatile(
-; CHECK-SAME: ptr writeonly [[P:%.*]], ptr readonly [[P2:%.*]]) #[[ATTR2]] {
----------------
antoniofrighetto wrote:
Slight confused with volatile here (probably more after Monday's meeting), I wonder whether at least some of the attributes could be retained. Particularly, why do we say provenance is captured too with volatile?
https://github.com/llvm/llvm-project/blob/c2ed0b1d825d7c75ca15b57812767ec3858c60db/llvm/lib/Analysis/CaptureTracking.cpp#L287-L291
I understand the address capture for MMIO purposes, but I'm less sure about how provenance would escape in this case (might be missing something here, but if the authority of accessing memory leaks out, _who_ would be performing a memory access on the observed address?).
https://github.com/llvm/llvm-project/pull/201136
More information about the llvm-commits
mailing list