Skip to content

Commit c05013f

Browse files
committed
SILOptimizer: Remove unnecessary code from replaceLoadsByKnownValue()
We no longer store the 'transparent' bit in the ApplyInst, so there's no need to recreate them.
1 parent 1f1e523 commit c05013f

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

lib/SILOptimizer/IPO/GlobalOpt.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -648,17 +648,6 @@ replaceLoadsByKnownValue(BuiltinInst *CallToOnce, SILFunction *AddrF,
648648
// Make this addressor transparent.
649649
AddrF->setTransparent(IsTransparent_t::IsTransparent);
650650

651-
for (int i = 0, e = Calls.size(); i < e; ++i) {
652-
auto *Call = Calls[i];
653-
SILBuilderWithScope B(Call);
654-
SmallVector<SILValue, 1> Args;
655-
auto *NewAI = B.createApply(Call->getLoc(), Call->getCallee(), Args, false);
656-
Call->replaceAllUsesWith(NewAI);
657-
eraseUsesOfInstruction(Call);
658-
recursivelyDeleteTriviallyDeadInstructions(Call, true);
659-
Calls[i] = NewAI;
660-
}
661-
662651
// Generate a getter from InitF which returns the value of the global.
663652
auto *GetterF = genGetterFromInit(FunctionBuilder, InitF, SILG->getDecl());
664653

0 commit comments

Comments
 (0)