-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[NFC][Coro] Use CloneFunctionInto for coroutine cloning instead of CloneFunction<Part> #129149
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
Conversation
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();
|
…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: llvm/llvm-project#129149, branch: users/artempyanykh/fast-coro-upstream-part2-take2/7
42726a3
to
f71d6b8
Compare
a73e948
to
0f7fb67
Compare
…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
f71d6b8
to
aa95bd8
Compare
0f7fb67
to
66695d8
Compare
…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
aa95bd8
to
e09a38c
Compare
66695d8
to
7801cdf
Compare
…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
e09a38c
to
1a92af8
Compare
7801cdf
to
df8853d
Compare
…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
1a92af8
to
2706a7d
Compare
df8853d
to
ce2bad5
Compare
…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
2706a7d
to
5f77df7
Compare
5f77df7
to
23b20f8
Compare
…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: llvm/llvm-project#129149, branch: users/artempyanykh/fast-coro-upstream-part2-take2/7
…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
23b20f8
to
c83d646
Compare
…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
c83d646
to
e874152
Compare
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