Skip to content

Commit 9846c6a

Browse files
authored
Merge pull request swiftlang#29841 from eeckstein/revert-inliner-change
2 parents f5dd887 + 92a764d commit 9846c6a

File tree

2 files changed

+0
-61
lines changed

2 files changed

+0
-61
lines changed

lib/SILOptimizer/Transforms/PerformanceInliner.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -526,15 +526,6 @@ bool SILPerformanceInliner::isProfitableToInline(
526526
return true;
527527
}
528528

529-
static bool returnsClosure(SILFunction *F) {
530-
for (SILBasicBlock &BB : *F) {
531-
if (auto *RI = dyn_cast<ReturnInst>(BB.getTerminator())) {
532-
return isa<PartialApplyInst>(RI->getOperand());
533-
}
534-
}
535-
return false;
536-
}
537-
538529
/// Checks if a given generic apply should be inlined unconditionally, i.e.
539530
/// without any complex analysis using e.g. a cost model.
540531
/// It returns true if a function should be inlined.
@@ -579,13 +570,6 @@ static Optional<bool> shouldInlineGeneric(FullApplySite AI) {
579570
return None;
580571
}
581572

582-
// The returned partial_apply of a thunk is most likely being optimized away
583-
// if inlined. Because some thunks cannot be specialized (e.g. if an opened
584-
// existential is in the subsitution list), we inline such thunks also in case
585-
// they are generic.
586-
if (Callee->isThunk() && returnsClosure(Callee))
587-
return true;
588-
589573
// All other generic functions should not be inlined if this kind of inlining
590574
// is disabled.
591575
if (!EnableSILInliningOfGenerics)

test/SILOptimizer/curry-thunk-elimination.swift

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)