Skip to content

[NFC][Cloning] Remove now unused FindDebugInfoToIdentityMap #129151

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

Summary:
This function is no longer needed.

Test Plan:
ninja check-llvm-unit

stack-info: PR: #129151, branch: users/artempyanykh/fast-coro-upstream-part2-take2/9
@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] Remove now unused FindDebugInfoToIdentityMap

Summary:
This function is no longer needed.

Test Plan:
ninja check-llvm-unit


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

2 Files Affected:

  • (modified) llvm/include/llvm/Transforms/Utils/Cloning.h (-19)
  • (modified) llvm/lib/Transforms/Utils/CloneFunction.cpp (-34)
diff --git a/llvm/include/llvm/Transforms/Utils/Cloning.h b/llvm/include/llvm/Transforms/Utils/Cloning.h
index 2252dda0b9aad..ae00c16e7eada 100644
--- a/llvm/include/llvm/Transforms/Utils/Cloning.h
+++ b/llvm/include/llvm/Transforms/Utils/Cloning.h
@@ -244,25 +244,6 @@ DISubprogram *CollectDebugInfoForCloning(const Function &F,
                                          CloneFunctionChangeType Changes,
                                          DebugInfoFinder &DIFinder);
 
-/// Based on \p Changes and \p DIFinder return debug info that needs to be
-/// identity mapped during Metadata cloning.
-///
-/// NOTE: Such \a MetadataSetTy can be used by \a CloneFunction* to directly
-/// specify metadata that should be identity mapped (and hence not cloned). The
-/// metadata will be identity mapped in \a ValueToValueMapTy on first use. There
-/// are several reasons for doing it this way rather than eagerly identity
-/// mapping metadata nodes in a \a ValueMap:
-/// 1. Mapping metadata is not cheap, particularly because of tracking.
-/// 2. When cloning a Function we identity map lots of global module-level
-///    metadata to avoid cloning it, while only a fraction of it is actually
-///    used by the function. Mapping on first use is a lot faster for modules
-///    with meaningful amount of debug info.
-/// 3. Eagerly identity mapping metadata makes it harder to cache module-level
-///    data (e.g. a set of metadata nodes in a \a DICompileUnit).
-MetadataSetTy FindDebugInfoToIdentityMap(CloneFunctionChangeType Changes,
-                                         DebugInfoFinder &DIFinder,
-                                         DISubprogram *SPClonedWithinModule);
-
 /// This class captures the data input to the InlineFunction call, and records
 /// the auxiliary results produced by it.
 class InlineFunctionInfo {
diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp
index 17c14c09082b0..11033aeec7dda 100644
--- a/llvm/lib/Transforms/Utils/CloneFunction.cpp
+++ b/llvm/lib/Transforms/Utils/CloneFunction.cpp
@@ -189,40 +189,6 @@ DISubprogram *llvm::CollectDebugInfoForCloning(const Function &F,
   return SPClonedWithinModule;
 }
 
-MetadataSetTy
-llvm::FindDebugInfoToIdentityMap(CloneFunctionChangeType Changes,
-                                 DebugInfoFinder &DIFinder,
-                                 DISubprogram *SPClonedWithinModule) {
-  if (Changes >= CloneFunctionChangeType::DifferentModule)
-    return {};
-
-  if (DIFinder.subprogram_count() == 0)
-    assert(!SPClonedWithinModule &&
-           "Subprogram should be in DIFinder->subprogram_count()...");
-
-  MetadataSetTy MD;
-
-  // Avoid cloning types, compile units, and (other) subprograms.
-  for (DISubprogram *ISP : DIFinder.subprograms())
-    if (ISP != SPClonedWithinModule)
-      MD.insert(ISP);
-
-  // If a subprogram isn't going to be cloned skip its lexical blocks as well.
-  for (DIScope *S : DIFinder.scopes()) {
-    auto *LScope = dyn_cast<DILocalScope>(S);
-    if (LScope && LScope->getSubprogram() != SPClonedWithinModule)
-      MD.insert(S);
-    }
-
-    for (DICompileUnit *CU : DIFinder.compile_units())
-      MD.insert(CU);
-
-    for (DIType *Type : DIFinder.types())
-      MD.insert(Type);
-
-  return MD;
-}
-
 void llvm::CloneFunctionMetadataInto(Function &NewFunc, const Function &OldFunc,
                                      ValueToValueMapTy &VMap,
                                      RemapFlags RemapFlag,

jollaitbot pushed a commit to sailfishos-mirror/llvm-project that referenced this pull request Feb 28, 2025
Summary:
This function is no longer needed.

Test Plan:
ninja check-llvm-unit

stack-info: PR: llvm/llvm-project#129151, branch: users/artempyanykh/fast-coro-upstream-part2-take2/9
@artempyanykh artempyanykh changed the base branch from users/artempyanykh/fast-coro-upstream-part2-take2/8 to main March 9, 2025 14:30
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/9 branch from d0782e5 to 2146d14 Compare March 9, 2025 14:30
@llvmbot llvmbot added the coroutines C++20 coroutines label Mar 9, 2025
@artempyanykh artempyanykh changed the base branch from main to users/artempyanykh/fast-coro-upstream-part2-take2/8 March 9, 2025 14:30
@artempyanykh artempyanykh changed the base branch from users/artempyanykh/fast-coro-upstream-part2-take2/8 to main March 9, 2025 14:32
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/9 branch from 2146d14 to 0ca9397 Compare March 9, 2025 14:32
@artempyanykh artempyanykh changed the base branch from main to users/artempyanykh/fast-coro-upstream-part2-take2/8 March 9, 2025 14:33
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/8 branch from e0ef90d to d16ea4b Compare March 9, 2025 15:49
artempyanykh added a commit that referenced this pull request Mar 9, 2025
Summary:
This function is no longer needed.

Test Plan:
ninja check-llvm-unit

stack-info: PR: #129151, branch: users/artempyanykh/fast-coro-upstream-part2-take2/9
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/9 branch from 0ca9397 to 3b18ff8 Compare March 9, 2025 15:50
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/8 branch from d16ea4b to b85266b Compare March 9, 2025 17:50
artempyanykh added a commit that referenced this pull request Mar 9, 2025
Summary:
This function is no longer needed.

Test Plan:
ninja check-llvm-unit

stack-info: PR: #129151, branch: users/artempyanykh/fast-coro-upstream-part2-take2/9
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/9 branch from 3b18ff8 to 7c2cbfc Compare March 9, 2025 17:50
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/8 branch from b85266b to 0febf8c Compare March 9, 2025 18:36
artempyanykh added a commit that referenced this pull request Mar 9, 2025
Summary:
This function is no longer needed.

Test Plan:
ninja check-llvm-unit

stack-info: PR: #129151, branch: users/artempyanykh/fast-coro-upstream-part2-take2/9
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/9 branch from 7c2cbfc to 8b042ee Compare March 9, 2025 18:36
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/8 branch from 0febf8c to d0c5ddc Compare March 12, 2025 11:19
artempyanykh added a commit that referenced this pull request Mar 12, 2025
Summary:
This function is no longer needed.

Test Plan:
ninja check-llvm-unit

stack-info: PR: #129151, branch: users/artempyanykh/fast-coro-upstream-part2-take2/9
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/9 branch from 8b042ee to 1327301 Compare March 12, 2025 11:20
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/8 branch from d0c5ddc to 4694b03 Compare March 12, 2025 23:33
artempyanykh added a commit that referenced this pull request Mar 12, 2025
Summary:
This function is no longer needed.

Test Plan:
ninja check-llvm-unit

stack-info: PR: #129151, branch: users/artempyanykh/fast-coro-upstream-part2-take2/9
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/9 branch from 1327301 to 8e94559 Compare March 12, 2025 23:33
@artempyanykh artempyanykh changed the base branch from users/artempyanykh/fast-coro-upstream-part2-take2/8 to main March 13, 2025 10:57
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/9 branch from 8e94559 to a415b77 Compare March 13, 2025 10:57
@artempyanykh artempyanykh changed the base branch from main to users/artempyanykh/fast-coro-upstream-part2-take2/8 March 13, 2025 10:57
jollaitbot pushed a commit to sailfishos-mirror/llvm-project that referenced this pull request Mar 13, 2025
Summary:
This function is no longer needed.

Test Plan:
ninja check-llvm-unit

stack-info: PR: llvm/llvm-project#129151, branch: users/artempyanykh/fast-coro-upstream-part2-take2/9
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/8 branch from 08707d6 to ebdc52c Compare March 13, 2025 17:18
artempyanykh added a commit that referenced this pull request Mar 13, 2025
Summary:
This function is no longer needed.

Test Plan:
ninja check-llvm-unit

stack-info: PR: #129151, branch: users/artempyanykh/fast-coro-upstream-part2-take2/9
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/9 branch from a415b77 to ddb729c Compare March 13, 2025 17:18
@artempyanykh artempyanykh changed the base branch from users/artempyanykh/fast-coro-upstream-part2-take2/8 to main March 14, 2025 12:16
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/9 branch from ddb729c to 18be509 Compare March 14, 2025 12:16
@artempyanykh artempyanykh changed the base branch from main to users/artempyanykh/fast-coro-upstream-part2-take2/8 March 14, 2025 12:16
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/8 branch from 2221ceb to 5038e78 Compare March 14, 2025 15:08
artempyanykh added a commit that referenced this pull request Mar 14, 2025
Summary:
This function is no longer needed.

Test Plan:
ninja check-llvm-unit

stack-info: PR: #129151, branch: users/artempyanykh/fast-coro-upstream-part2-take2/9
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/9 branch from 18be509 to 8da28de Compare March 14, 2025 15:08
Base automatically changed from users/artempyanykh/fast-coro-upstream-part2-take2/8 to main March 14, 2025 19:33
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream-part2-take2/9 branch from 8da28de to a597f7e Compare March 14, 2025 19:34
@artempyanykh artempyanykh merged commit 1e6ba3c into main Mar 15, 2025
11 checks passed
@artempyanykh artempyanykh deleted the users/artempyanykh/fast-coro-upstream-part2-take2/9 branch March 15, 2025 11:44
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