aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/InlineFunction.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2025-05-27 15:15:57 +0200
committerGitHub <noreply@github.com>2025-05-27 15:15:57 +0200
commit904d0c293e4de2c63ef473bbd2b1d3f56f113402 (patch)
treed7990b6e618e3a4d1bc799e3d382d5dd7e7072b4 /llvm/lib/Transforms/Utils/InlineFunction.cpp
parent29db3058a8e50775cd236ef4462ae04fdc4ba90c (diff)
downloadllvm-904d0c293e4de2c63ef473bbd2b1d3f56f113402.zip
llvm-904d0c293e4de2c63ef473bbd2b1d3f56f113402.tar.gz
llvm-904d0c293e4de2c63ef473bbd2b1d3f56f113402.tar.bz2
[Inline] Only consider provenance captures for scoped alias metadata (#138540)
When determining whether an escape source may alias with a noalias argument, only take provenance captures into account. If only the address of the argument was captured, an access through the escape source is not legal.
Diffstat (limited to 'llvm/lib/Transforms/Utils/InlineFunction.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/InlineFunction.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp
index b4aae88..21467a90 100644
--- a/llvm/lib/Transforms/Utils/InlineFunction.cpp
+++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp
@@ -1313,7 +1313,9 @@ static void AddAliasScopeMetadata(CallBase &CB, ValueToValueMapTy &VMap,
// nocapture only guarantees that no copies outlive the function, not
// that the value cannot be locally captured.
if (!RequiresNoCaptureBefore ||
- !PointerMayBeCapturedBefore(A, /* ReturnCaptures */ false, I, &DT))
+ !capturesAnything(PointerMayBeCapturedBefore(
+ A, /*ReturnCaptures=*/false, I, &DT, /*IncludeI=*/false,
+ CaptureComponents::Provenance)))
NoAliases.push_back(NewScopes[A]);
}