================ @@ -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); + + if (OMPBuilder.Config.isTargetDevice()) { + std::vector<llvm::WeakTrackingVH> LLVMCompilerUsed; ---------------- jdoerfert wrote:
Why do you need a vector here, especially of tracking VH? I guess what you want is: ``` auto *V = emitExecMode(...) emitUsed("llvm.compiler.used", {V}, OMPBuilder.M); ``` https://github.com/llvm/llvm-project/pull/116051 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits