aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/InlineFunction.cpp
diff options
context:
space:
mode:
authorgoldsteinn <35538541+goldsteinn@users.noreply.github.com>2024-10-15 10:25:16 -0400
committerGitHub <noreply@github.com>2024-10-15 09:25:16 -0500
commit3c777f04f065dda5f0c80eaaef2a7f623ccc20ed (patch)
tree95340a18da38d59c0d5aeb4866c4b41d3d4cc7b0 /llvm/lib/Transforms/Utils/InlineFunction.cpp
parente100e4afc90afd4e6b8c7f692a553beacd214539 (diff)
downloadllvm-3c777f04f065dda5f0c80eaaef2a7f623ccc20ed.zip
llvm-3c777f04f065dda5f0c80eaaef2a7f623ccc20ed.tar.gz
llvm-3c777f04f065dda5f0c80eaaef2a7f623ccc20ed.tar.bz2
[Inliner] Don't propagate access attr to byval params (#112256)
- **[Inliner] Add tests for bad propagationg of access attr for `byval` param; NFC** - **[Inliner] Don't propagate access attr to `byval` params** We previously only handled the case where the `byval` attr was in the callbase's param attr list. This PR also handles the case if the `ByVal` was a param attr on the function's param attr list.
Diffstat (limited to 'llvm/lib/Transforms/Utils/InlineFunction.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/InlineFunction.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp
index 110fd6d..55ad2b6d 100644
--- a/llvm/lib/Transforms/Utils/InlineFunction.cpp
+++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp
@@ -1398,7 +1398,7 @@ static void AddParamAndFnBasicAttributes(const CallBase &CB,
if (!Arg)
continue;
- if (AL.hasParamAttr(I, Attribute::ByVal))
+ if (NewInnerCB->paramHasAttr(I, Attribute::ByVal))
// It's unsound to propagate memory attributes to byval arguments.
// Even if CalledFunction doesn't e.g. write to the argument,
// the call to NewInnerCB may write to its by-value copy.