Skip to content

Commit 1e6ba3c

Browse files
authored
[NFC][Cloning] Remove now unused FindDebugInfoToIdentityMap (#129151)
Summary: This function is no longer needed. Test Plan: ninja check-llvm-unit
1 parent 6a030b3 commit 1e6ba3c

File tree

2 files changed

+0
-53
lines changed

2 files changed

+0
-53
lines changed

llvm/include/llvm/Transforms/Utils/Cloning.h

-19
Original file line numberDiff line numberDiff line change
@@ -244,25 +244,6 @@ DISubprogram *CollectDebugInfoForCloning(const Function &F,
244244
CloneFunctionChangeType Changes,
245245
DebugInfoFinder &DIFinder);
246246

247-
/// Based on \p Changes and \p DIFinder return debug info that needs to be
248-
/// identity mapped during Metadata cloning.
249-
///
250-
/// NOTE: Such \a MetadataSetTy can be used by \a CloneFunction* to directly
251-
/// specify metadata that should be identity mapped (and hence not cloned). The
252-
/// metadata will be identity mapped in \a ValueToValueMapTy on first use. There
253-
/// are several reasons for doing it this way rather than eagerly identity
254-
/// mapping metadata nodes in a \a ValueMap:
255-
/// 1. Mapping metadata is not cheap, particularly because of tracking.
256-
/// 2. When cloning a Function we identity map lots of global module-level
257-
/// metadata to avoid cloning it, while only a fraction of it is actually
258-
/// used by the function. Mapping on first use is a lot faster for modules
259-
/// with meaningful amount of debug info.
260-
/// 3. Eagerly identity mapping metadata makes it harder to cache module-level
261-
/// data (e.g. a set of metadata nodes in a \a DICompileUnit).
262-
MetadataSetTy FindDebugInfoToIdentityMap(CloneFunctionChangeType Changes,
263-
DebugInfoFinder &DIFinder,
264-
DISubprogram *SPClonedWithinModule);
265-
266247
/// This class captures the data input to the InlineFunction call, and records
267248
/// the auxiliary results produced by it.
268249
class InlineFunctionInfo {

llvm/lib/Transforms/Utils/CloneFunction.cpp

-34
Original file line numberDiff line numberDiff line change
@@ -189,40 +189,6 @@ DISubprogram *llvm::CollectDebugInfoForCloning(const Function &F,
189189
return SPClonedWithinModule;
190190
}
191191

192-
MetadataSetTy
193-
llvm::FindDebugInfoToIdentityMap(CloneFunctionChangeType Changes,
194-
DebugInfoFinder &DIFinder,
195-
DISubprogram *SPClonedWithinModule) {
196-
if (Changes >= CloneFunctionChangeType::DifferentModule)
197-
return {};
198-
199-
if (DIFinder.subprogram_count() == 0)
200-
assert(!SPClonedWithinModule &&
201-
"Subprogram should be in DIFinder->subprogram_count()...");
202-
203-
MetadataSetTy MD;
204-
205-
// Avoid cloning types, compile units, and (other) subprograms.
206-
for (DISubprogram *ISP : DIFinder.subprograms())
207-
if (ISP != SPClonedWithinModule)
208-
MD.insert(ISP);
209-
210-
// If a subprogram isn't going to be cloned skip its lexical blocks as well.
211-
for (DIScope *S : DIFinder.scopes()) {
212-
auto *LScope = dyn_cast<DILocalScope>(S);
213-
if (LScope && LScope->getSubprogram() != SPClonedWithinModule)
214-
MD.insert(S);
215-
}
216-
217-
for (DICompileUnit *CU : DIFinder.compile_units())
218-
MD.insert(CU);
219-
220-
for (DIType *Type : DIFinder.types())
221-
MD.insert(Type);
222-
223-
return MD;
224-
}
225-
226192
void llvm::CloneFunctionMetadataInto(Function &NewFunc, const Function &OldFunc,
227193
ValueToValueMapTy &VMap,
228194
RemapFlags RemapFlag,

0 commit comments

Comments
 (0)