https://github.com/artempyanykh updated https://github.com/llvm/llvm-project/pull/129149
>From e09a38c4b0eae5f28b70aecf5197607ecdd87220 Mon Sep 17 00:00:00 2001 From: Artem Pianykh <a...@fb.com> Date: Tue, 25 Feb 2025 12:42:14 -0800 Subject: [PATCH] [NFC][Coro] Use CloneFunctionInto for coroutine cloning instead of CloneFunction<Part> Summary: CloneFunctionInto now is fast on its own and we don't need to use CloneFunctionAttributes/Metadata/Body separately. CommonDebugInfo in CoroClone is now unused and is cleaned up separately in the next diff in the stack. Test Plan: ninja check-all stack-info: PR: https://github.com/llvm/llvm-project/pull/129149, branch: users/artempyanykh/fast-coro-upstream-part2-take2/7 --- llvm/lib/Transforms/Coroutines/CoroSplit.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/llvm/lib/Transforms/Coroutines/CoroSplit.cpp b/llvm/lib/Transforms/Coroutines/CoroSplit.cpp index b2c4e64319725..fabbf5f020a74 100644 --- a/llvm/lib/Transforms/Coroutines/CoroSplit.cpp +++ b/llvm/lib/Transforms/Coroutines/CoroSplit.cpp @@ -921,14 +921,8 @@ void coro::BaseCloner::create() { auto savedLinkage = NewF->getLinkage(); NewF->setLinkage(llvm::GlobalValue::ExternalLinkage); - MetadataPredicate IdentityMD = [&](const Metadata *MD) { - return CommonDebugInfo.contains(MD); - }; - CloneFunctionAttributesInto(NewF, &OrigF, VMap, false); - CloneFunctionMetadataInto(*NewF, OrigF, VMap, RF_None, nullptr, nullptr, - &IdentityMD); - CloneFunctionBodyInto(*NewF, OrigF, VMap, RF_None, Returns, "", nullptr, - nullptr, nullptr, &IdentityMD); + CloneFunctionInto(NewF, &OrigF, VMap, + CloneFunctionChangeType::LocalChangesOnly, Returns); auto &Context = NewF->getContext(); _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits