diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2025-04-08 22:53:17 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-08 22:53:17 +0700 |
commit | b0cb672b9968eeee6eb022e98476957dbdf8e6e2 (patch) | |
tree | 828694a15474146fcf8bebee4d72a67b765afc01 /llvm/lib/Transforms/Utils/InlineFunction.cpp | |
parent | bd49d278c6aa9ac5cc8e5917003d4f710887548d (diff) | |
download | llvm-b0cb672b9968eeee6eb022e98476957dbdf8e6e2.zip llvm-b0cb672b9968eeee6eb022e98476957dbdf8e6e2.tar.gz llvm-b0cb672b9968eeee6eb022e98476957dbdf8e6e2.tar.bz2 |
Inline: Propagate callsite nofpclass attribute
(#134800)
Fixes #134070
Diffstat (limited to 'llvm/lib/Transforms/Utils/InlineFunction.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/InlineFunction.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp index 5beee1f..c65bf16 100644 --- a/llvm/lib/Transforms/Utils/InlineFunction.cpp +++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp @@ -1381,7 +1381,8 @@ static void AddParamAndFnBasicAttributes(const CallBase &CB, // behavior was just using a poison value. static const Attribute::AttrKind ExactAttrsToPropagate[] = { Attribute::Dereferenceable, Attribute::DereferenceableOrNull, - Attribute::NonNull, Attribute::Alignment, Attribute::Range}; + Attribute::NonNull, Attribute::NoFPClass, + Attribute::Alignment, Attribute::Range}; for (unsigned I = 0, E = CB.arg_size(); I < E; ++I) { ValidObjParamAttrs.emplace_back(AttrBuilder{CB.getContext()}); @@ -1463,6 +1464,13 @@ static void AddParamAndFnBasicAttributes(const CallBase &CB, NewAB.addRangeAttr(CombinedRange); } } + + if (FPClassTest ExistingNoFP = AL.getParamNoFPClass(I)) { + FPClassTest NewNoFP = + NewAB.getAttribute(Attribute::NoFPClass).getNoFPClass(); + NewAB.addNoFPClassAttr(ExistingNoFP | NewNoFP); + } + AL = AL.addParamAttributes(Context, I, NewAB); } else if (NewInnerCB->getArgOperand(I)->getType()->isPointerTy()) { // Check if the underlying value for the parameter is an argument. |