Skip to content

[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

Merged

Conversation

artempyanykh
Copy link
Contributor

@artempyanykh artempyanykh commented Feb 27, 2025

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

@llvmbot
Copy link
Member

llvmbot commented Feb 27, 2025

@llvm/pr-subscribers-coroutines

Author: Artem Pianykh (artempyanykh)

Changes

Stacked PRs:

  • #129154
  • #129153
  • #129152
  • #129151
  • #129150
  • ->#129149
  • #129148
  • #129147
  • #129146
  • #129145
  • #129144
  • #129143

[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


Full diff: https://github.com/llvm/llvm-project/pull/129149.diff

1 Files Affected:

  • (modified) llvm/lib/Transforms/Coroutines/CoroSplit.cpp (+2-8)
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();
 

@llvmbot
Copy link
Member

llvmbot commented Feb 27, 2025

@llvm/pr-subscribers-llvm-transforms

Author: Artem Pianykh (artempyanykh)

Changes

Stacked PRs:

  • #129154
  • #129153
  • #129152
  • #129151
  • #129150
  • ->#129149
  • #129148
  • #129147
  • #129146
  • #129145
  • #129144
  • #129143

[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


Full diff: https://github.com/llvm/llvm-project/pull/129149.diff

1 Files Affected:

  • (modified) llvm/lib/Transforms/Coroutines/CoroSplit.cpp (+2-8)
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();
 

jollaitbot pushed a commit to sailfishos-mirror/llvm-project that referenced this pull request Feb 28, 2025
…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
@artempyanykh artempyanykh changed the base branch from users/artempyanykh/fast-coro-upstream-part2-take2/6 to main March 9, 2025 14:30
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/7 branch from 42726a3 to f71d6b8 Compare March 9, 2025 14:30
@artempyanykh artempyanykh changed the base branch from main to users/artempyanykh/fast-coro-upstream-part2-take2/6 March 9, 2025 14:30
@artempyanykh artempyanykh changed the base branch from users/artempyanykh/fast-coro-upstream-part2-take2/6 to main March 9, 2025 14:32
@artempyanykh artempyanykh changed the base branch from main to users/artempyanykh/fast-coro-upstream-part2-take2/6 March 9, 2025 14:33
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/6 branch from a73e948 to 0f7fb67 Compare March 9, 2025 15:49
artempyanykh added a commit that referenced this pull request Mar 9, 2025
…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
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/7 branch from f71d6b8 to aa95bd8 Compare March 9, 2025 15:49
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/6 branch from 0f7fb67 to 66695d8 Compare March 9, 2025 17:49
artempyanykh added a commit that referenced this pull request Mar 9, 2025
…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
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/7 branch from aa95bd8 to e09a38c Compare March 9, 2025 17:49
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/6 branch from 66695d8 to 7801cdf Compare March 9, 2025 18:36
artempyanykh added a commit that referenced this pull request Mar 9, 2025
…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
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/7 branch from e09a38c to 1a92af8 Compare March 9, 2025 18:36
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/6 branch from 7801cdf to df8853d Compare March 12, 2025 11:19
artempyanykh added a commit that referenced this pull request Mar 12, 2025
…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
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/7 branch from 1a92af8 to 2706a7d Compare March 12, 2025 11:19
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/6 branch from df8853d to ce2bad5 Compare March 12, 2025 23:33
artempyanykh added a commit that referenced this pull request Mar 12, 2025
…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
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/7 branch from 2706a7d to 5f77df7 Compare March 12, 2025 23:33
@artempyanykh artempyanykh changed the base branch from users/artempyanykh/fast-coro-upstream-part2-take2/6 to main March 13, 2025 10:57
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/7 branch from 5f77df7 to 23b20f8 Compare March 13, 2025 10:57
@artempyanykh artempyanykh changed the base branch from main to users/artempyanykh/fast-coro-upstream-part2-take2/6 March 13, 2025 10:57
jollaitbot pushed a commit to sailfishos-mirror/llvm-project that referenced this pull request Mar 13, 2025
…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
Base automatically changed from users/artempyanykh/fast-coro-upstream-part2-take2/6 to main March 13, 2025 17:18
artempyanykh added a commit that referenced this pull request Mar 13, 2025
…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
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/7 branch from 23b20f8 to c83d646 Compare March 13, 2025 17:18
…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
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/7 branch from c83d646 to e874152 Compare March 14, 2025 12:16
@artempyanykh artempyanykh merged commit 841f463 into main Mar 14, 2025
11 checks passed
@artempyanykh artempyanykh deleted the users/artempyanykh/fast-coro-upstream-part2-take2/7 branch March 14, 2025 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants