Skip to content

Commit dc75d75

Browse files
committed
[𝘀𝗽𝗿] initial version
Created using spr 1.3.6-beta.1
1 parent dbb8434 commit dc75d75

File tree

4 files changed

+1
-42
lines changed

4 files changed

+1
-42
lines changed

llvm/include/llvm/IR/Module.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -877,15 +877,6 @@ class LLVM_ABI Module {
877877
}
878878
/// @}
879879

880-
/// Destroy ConstantArrays in LLVMContext if they are not used.
881-
/// ConstantArrays constructed during linking can cause quadratic memory
882-
/// explosion. Releasing all unused constants can cause a 20% LTO compile-time
883-
/// slowdown for a large application.
884-
///
885-
/// NOTE: Constants are currently owned by LLVMContext. This can then only
886-
/// be called where all uses of the LLVMContext are understood.
887-
void dropTriviallyDeadConstantArrays();
888-
889880
/// @name Utility functions for printing and dumping Module objects
890881
/// @{
891882

llvm/lib/IR/LLVMContextImpl.cpp

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -147,33 +147,6 @@ LLVMContextImpl::~LLVMContextImpl() {
147147
delete Pair.second;
148148
}
149149

150-
void LLVMContextImpl::dropTriviallyDeadConstantArrays() {
151-
SmallSetVector<ConstantArray *, 4> WorkList;
152-
153-
// When ArrayConstants are of substantial size and only a few in them are
154-
// dead, starting WorkList with all elements of ArrayConstants can be
155-
// wasteful. Instead, starting WorkList with only elements that have empty
156-
// uses.
157-
for (ConstantArray *C : ArrayConstants)
158-
if (C->use_empty())
159-
WorkList.insert(C);
160-
161-
while (!WorkList.empty()) {
162-
ConstantArray *C = WorkList.pop_back_val();
163-
if (C->use_empty()) {
164-
for (const Use &Op : C->operands()) {
165-
if (auto *COp = dyn_cast<ConstantArray>(Op))
166-
WorkList.insert(COp);
167-
}
168-
C->destroyConstant();
169-
}
170-
}
171-
}
172-
173-
void Module::dropTriviallyDeadConstantArrays() {
174-
Context.pImpl->dropTriviallyDeadConstantArrays();
175-
}
176-
177150
namespace llvm {
178151

179152
/// Make MDOperand transparent for hashing.

llvm/lib/IR/LLVMContextImpl.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1808,9 +1808,6 @@ class LLVMContextImpl {
18081808
LLVMContextImpl(LLVMContext &C);
18091809
~LLVMContextImpl();
18101810

1811-
/// Destroy the ConstantArrays if they are not used.
1812-
void dropTriviallyDeadConstantArrays();
1813-
18141811
mutable OptPassGate *OPG = nullptr;
18151812

18161813
/// Access the object which can disable optional passes and individual

llvm/lib/Linker/IRMover.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1766,7 +1766,5 @@ Error IRMover::move(std::unique_ptr<Module> Src,
17661766
IRLinker TheIRLinker(Composite, SharedMDs, IdentifiedStructTypes,
17671767
std::move(Src), ValuesToLink, std::move(AddLazyFor),
17681768
IsPerformingImport);
1769-
Error E = TheIRLinker.run();
1770-
Composite.dropTriviallyDeadConstantArrays();
1771-
return E;
1769+
return TheIRLinker.run();
17721770
}

0 commit comments

Comments
 (0)