aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib
diff options
context:
space:
mode:
authorJohannes Doerfert <johannes@jdoerfert.de>2020-01-12 00:18:07 -0600
committerJohannes Doerfert <johannes@jdoerfert.de>2020-01-23 18:13:52 -0600
commit2baf000ecc06209c70e46e19cf947a8f77cf0cad (patch)
tree2528427dc62e25906211900f8af611411eccde11 /llvm/lib
parent30ae859c696748e1314788367226e4c65669f526 (diff)
downloadllvm-2baf000ecc06209c70e46e19cf947a8f77cf0cad.zip
llvm-2baf000ecc06209c70e46e19cf947a8f77cf0cad.tar.gz
llvm-2baf000ecc06209c70e46e19cf947a8f77cf0cad.tar.bz2
[Attributor] `byval` arguments are always `noalias`
`byval` introduces a local copy of the argument. That copy cannot alias anything.
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/IPO/Attributor.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/IPO/Attributor.cpp b/llvm/lib/Transforms/IPO/Attributor.cpp
index 5eb21a0..19dc998 100644
--- a/llvm/lib/Transforms/IPO/Attributor.cpp
+++ b/llvm/lib/Transforms/IPO/Attributor.cpp
@@ -2386,6 +2386,14 @@ struct AANoAliasArgument final
using Base = AAArgumentFromCallSiteArguments<AANoAlias, AANoAliasImpl>;
AANoAliasArgument(const IRPosition &IRP) : Base(IRP) {}
+ /// See AbstractAttribute::initialize(...).
+ void initialize(Attributor &A) override {
+ Base::initialize(A);
+ // See callsite argument attribute and callee argument attribute.
+ if (hasAttr({Attribute::ByVal}))
+ indicateOptimisticFixpoint();
+ }
+
/// See AbstractAttribute::update(...).
ChangeStatus updateImpl(Attributor &A) override {
// We have to make sure no-alias on the argument does not break