[llvm-branch-commits] [llvm] [mlir] [OMPIRBuilder] Support runtime number of teams and threads, and SPMD mode (PR #116051)
Johannes Doerfert via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Sun Nov 17 09:04:08 PST 2024
================
@@ -6758,6 +6793,27 @@ static Expected<Function *> createOutlinedFunction(
auto Func =
Function::Create(FuncType, GlobalValue::InternalLinkage, FuncName, M);
+ // Forward target-cpu and target-features function attributes from the
+ // original function to the new outlined function.
+ Function *ParentFn = Builder.GetInsertBlock()->getParent();
+
+ auto TargetCpuAttr = ParentFn->getFnAttribute("target-cpu");
+ if (TargetCpuAttr.isStringAttribute())
+ Func->addFnAttr(TargetCpuAttr);
+
+ auto TargetFeaturesAttr = ParentFn->getFnAttribute("target-features");
+ if (TargetFeaturesAttr.isStringAttribute())
+ Func->addFnAttr(TargetFeaturesAttr);
----------------
jdoerfert wrote:
How is this related to the PR?
https://github.com/llvm/llvm-project/pull/116051
More information about the llvm-branch-commits
mailing list