-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NFC][Coro] Use CloneFunctionInto for coroutine cloning instead of CloneFunction<Part> #129149
base: users/artempyanykh/fast-coro-upstream-part2-take2/6
Are you sure you want to change the base?
Conversation
…oneFunction<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: #129149, branch: users/artempyanykh/fast-coro-upstream-part2-take2/7
4cb677e
to
2773399
Compare
dc1c214
to
42726a3
Compare
@llvm/pr-subscribers-coroutines Author: Artem Pianykh (artempyanykh) ChangesStacked PRs:
[NFC][Coro] Use CloneFunctionInto for coroutine cloning instead of CloneFunction<Part>Summary: CommonDebugInfo in CoroClone is now unused and is cleaned up separately Test Plan: Full diff: https://github.com/llvm/llvm-project/pull/129149.diff 1 Files Affected:
diff --git a/llvm/lib/Transforms/Coroutines/CoroSplit.cpp b/llvm/lib/Transforms/Coroutines/CoroSplit.cpp
index 8179d5c0b29b5..7bc0a400ac1fb 100644
--- a/llvm/lib/Transforms/Coroutines/CoroSplit.cpp
+++ b/llvm/lib/Transforms/Coroutines/CoroSplit.cpp
@@ -922,14 +922,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/pr-subscribers-llvm-transforms Author: Artem Pianykh (artempyanykh) ChangesStacked PRs:
[NFC][Coro] Use CloneFunctionInto for coroutine cloning instead of CloneFunction<Part>Summary: CommonDebugInfo in CoroClone is now unused and is cleaned up separately Test Plan: Full diff: https://github.com/llvm/llvm-project/pull/129149.diff 1 Files Affected:
diff --git a/llvm/lib/Transforms/Coroutines/CoroSplit.cpp b/llvm/lib/Transforms/Coroutines/CoroSplit.cpp
index 8179d5c0b29b5..7bc0a400ac1fb 100644
--- a/llvm/lib/Transforms/Coroutines/CoroSplit.cpp
+++ b/llvm/lib/Transforms/Coroutines/CoroSplit.cpp
@@ -922,14 +922,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();
|
Stacked PRs:
[NFC][Coro] Use CloneFunctionInto for coroutine cloning instead of CloneFunction
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