Skip to content

[NFC][Cloning] Move DebugInfoFinder decl closer to its place of usage #129154

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

Summary:
This makes it clear that DIFinder is only really necessary for llvm.dbg.cu update.

Test Plan:
ninja check-llvm-unit

stack-info: PR: #129154, branch: users/artempyanykh/fast-coro-upstream-part2-take2/12
artempyanykh added a commit that referenced this pull request Feb 27, 2025
Summary:
This makes it clear that DIFinder is only really necessary for llvm.dbg.cu update.

Test Plan:
ninja check-llvm-unit

stack-info: PR: #129154, branch: users/artempyanykh/fast-coro-upstream-part2-take2/12
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/11 branch from 7a07326 to 400a806 Compare February 27, 2025 23:35
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/12 branch from e3530ca to 59c36b2 Compare February 27, 2025 23:35
@llvmbot
Copy link
Member

llvmbot commented Feb 27, 2025

@llvm/pr-subscribers-coroutines

@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][Cloning] Move DebugInfoFinder decl closer to its place of usage

Summary:
This makes it clear that DIFinder is only really necessary for llvm.dbg.cu update.

Test Plan:
ninja check-llvm-unit


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

1 Files Affected:

  • (modified) llvm/lib/Transforms/Utils/CloneFunction.cpp (+2-3)
diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp
index 979cbad0d82c0..3af07594c848b 100644
--- a/llvm/lib/Transforms/Utils/CloneFunction.cpp
+++ b/llvm/lib/Transforms/Utils/CloneFunction.cpp
@@ -266,8 +266,6 @@ void llvm::CloneFunctionInto(Function *NewFunc, const Function *OldFunc,
   if (OldFunc->isDeclaration())
     return;
 
-  DebugInfoFinder DIFinder;
-
   if (Changes < CloneFunctionChangeType::DifferentModule) {
     assert((NewFunc->getParent() == nullptr ||
             NewFunc->getParent() == OldFunc->getParent()) &&
@@ -320,7 +318,8 @@ void llvm::CloneFunctionInto(Function *NewFunc, const Function *OldFunc,
     Visited.insert(Operand);
 
   // Collect and clone all the compile units referenced from the instructions in
-  // the function (e.g. as a scope).
+  // the function (e.g. as instructions' scope).
+  DebugInfoFinder DIFinder;
   collectDebugInfoFromInstructions(*OldFunc, DIFinder);
   for (auto *Unit : DIFinder.compile_units()) {
     MDNode *MappedUnit =

Copy link
Contributor

@felipepiovezan felipepiovezan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@artempyanykh artempyanykh changed the base branch from users/artempyanykh/fast-coro-upstream-part2-take2/11 to main March 9, 2025 14:30
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/12 branch from 59c36b2 to 252e104 Compare March 9, 2025 14:30
@artempyanykh artempyanykh changed the base branch from main to users/artempyanykh/fast-coro-upstream-part2-take2/11 March 9, 2025 14:30
@artempyanykh artempyanykh changed the base branch from users/artempyanykh/fast-coro-upstream-part2-take2/11 to main March 9, 2025 14:32
artempyanykh added a commit that referenced this pull request Mar 9, 2025
Summary:
This makes it clear that DIFinder is only really necessary for llvm.dbg.cu update.

Test Plan:
ninja check-llvm-unit

stack-info: PR: #129154, branch: users/artempyanykh/fast-coro-upstream-part2-take2/12
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/12 branch from 252e104 to 279d028 Compare March 9, 2025 14:32
@artempyanykh artempyanykh changed the base branch from main to users/artempyanykh/fast-coro-upstream-part2-take2/11 March 9, 2025 14:33
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/11 branch from e2e5b39 to f711cec Compare March 9, 2025 15:50
artempyanykh added a commit that referenced this pull request Mar 9, 2025
Summary:
This makes it clear that DIFinder is only really necessary for llvm.dbg.cu update.

Test Plan:
ninja check-llvm-unit

stack-info: PR: #129154, branch: users/artempyanykh/fast-coro-upstream-part2-take2/12
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/12 branch from 279d028 to dab28ad Compare March 9, 2025 15:50
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/11 branch from f711cec to fd9ac7b Compare March 9, 2025 17:50
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/12 branch from cc3662c to d20de56 Compare March 12, 2025 23:34
@artempyanykh artempyanykh changed the base branch from users/artempyanykh/fast-coro-upstream-part2-take2/11 to main March 13, 2025 10:57
artempyanykh added a commit that referenced this pull request Mar 13, 2025
Summary:
This makes it clear that DIFinder is only really necessary for llvm.dbg.cu update.

Test Plan:
ninja check-llvm-unit

stack-info: PR: #129154, branch: users/artempyanykh/fast-coro-upstream-part2-take2/12
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/12 branch from d20de56 to 0fd78cd Compare March 13, 2025 10:57
@llvmbot llvmbot added the coroutines C++20 coroutines label Mar 13, 2025
@artempyanykh artempyanykh changed the base branch from main to users/artempyanykh/fast-coro-upstream-part2-take2/11 March 13, 2025 10:57
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/11 branch from 95de6d8 to faa3b3a Compare March 13, 2025 17:18
artempyanykh added a commit that referenced this pull request Mar 13, 2025
Summary:
This makes it clear that DIFinder is only really necessary for llvm.dbg.cu update.

Test Plan:
ninja check-llvm-unit

stack-info: PR: #129154, branch: users/artempyanykh/fast-coro-upstream-part2-take2/12
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/12 branch from 0fd78cd to 20febd9 Compare March 13, 2025 17:19
@artempyanykh artempyanykh changed the base branch from users/artempyanykh/fast-coro-upstream-part2-take2/11 to main March 14, 2025 12:16
artempyanykh added a commit that referenced this pull request Mar 14, 2025
Summary:
This makes it clear that DIFinder is only really necessary for llvm.dbg.cu update.

Test Plan:
ninja check-llvm-unit

stack-info: PR: #129154, branch: users/artempyanykh/fast-coro-upstream-part2-take2/12
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/12 branch from 20febd9 to dff5d31 Compare March 14, 2025 12:16
@artempyanykh artempyanykh changed the base branch from main to users/artempyanykh/fast-coro-upstream-part2-take2/11 March 14, 2025 12:16
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/11 branch from 4e49c7f to cd22b53 Compare March 14, 2025 15:09
artempyanykh added a commit that referenced this pull request Mar 14, 2025
Summary:
This makes it clear that DIFinder is only really necessary for llvm.dbg.cu update.

Test Plan:
ninja check-llvm-unit

stack-info: PR: #129154, branch: users/artempyanykh/fast-coro-upstream-part2-take2/12
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/12 branch from dff5d31 to 57c903c Compare March 14, 2025 15:09
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/11 branch from cd22b53 to 3779d77 Compare March 14, 2025 19:34
artempyanykh added a commit that referenced this pull request Mar 14, 2025
Summary:
This makes it clear that DIFinder is only really necessary for llvm.dbg.cu update.

Test Plan:
ninja check-llvm-unit

stack-info: PR: #129154, branch: users/artempyanykh/fast-coro-upstream-part2-take2/12
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/12 branch from 57c903c to cf575ea Compare March 14, 2025 19:34
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/11 branch from 3779d77 to 1335a81 Compare March 15, 2025 11:44
artempyanykh added a commit that referenced this pull request Mar 15, 2025
Summary:
This makes it clear that DIFinder is only really necessary for llvm.dbg.cu update.

Test Plan:
ninja check-llvm-unit

stack-info: PR: #129154, branch: users/artempyanykh/fast-coro-upstream-part2-take2/12
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/12 branch from cf575ea to 80ad60f Compare March 15, 2025 11:44
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/11 branch from 1335a81 to 9c588b3 Compare March 15, 2025 16:47
artempyanykh added a commit that referenced this pull request Mar 15, 2025
Summary:
This makes it clear that DIFinder is only really necessary for llvm.dbg.cu update.

Test Plan:
ninja check-llvm-unit

stack-info: PR: #129154, branch: users/artempyanykh/fast-coro-upstream-part2-take2/12
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/12 branch from 80ad60f to 5075426 Compare March 15, 2025 16:48
Base automatically changed from users/artempyanykh/fast-coro-upstream-part2-take2/11 to main March 15, 2025 19:28
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/12 branch from 5075426 to d7dbad2 Compare March 15, 2025 19:28
@artempyanykh artempyanykh merged commit dc9a183 into main Mar 16, 2025
12 of 15 checks passed
@artempyanykh artempyanykh deleted the users/artempyanykh/fast-coro-upstream-part2-take2/12 branch March 16, 2025 11:25
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