[llvm] [Inliner] Don't propagate memory attributes to byval params (PR #93381)
via llvm-commits
llvm-commits at lists.llvm.org
Sat May 25 19:18:43 PDT 2024
================
@@ -1389,6 +1389,12 @@ static void AddParamAndFnBasicAttributes(const CallBase &CB,
if (!Arg)
continue;
+ if (AL.hasParamAttr(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.
+ continue;
+
----------------
goldsteinn wrote:
You could keep the original attributes and only drop if they are new?
https://github.com/llvm/llvm-project/pull/93381
More information about the llvm-commits
mailing list