File tree Expand file tree Collapse file tree 3 files changed +466
-92
lines changed
include/swift/SILOptimizer/Utils Expand file tree Collapse file tree 3 files changed +466
-92
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,15 @@ class ReabstractionInfo {
115
115
bool HasUnboundGenericParams);
116
116
117
117
void createSubstitutedAndSpecializedTypes ();
118
+ bool prepareAndCheck (ApplySite Apply, SILFunction *Callee,
119
+ SubstitutionList ParamSubs);
120
+ void specializeConcreteAndGenericSubstitutions (ApplySite Apply,
121
+ SILFunction *Callee,
122
+ SubstitutionList ParamSubs);
123
+ void specializeConcreteSubstitutions (ApplySite Apply, SILFunction *Callee,
124
+ SubstitutionList ParamSubs);
125
+
126
+ ReabstractionInfo () {}
118
127
public:
119
128
// / Constructs the ReabstractionInfo for generic function \p Orig with
120
129
// / substitutions \p ParamSubs.
@@ -219,6 +228,10 @@ class ReabstractionInfo {
219
228
220
229
// / Returns true if it is a partial generic specialization.
221
230
bool isPartialSpecialization () const ;
231
+
232
+ // / Returns true if a given apply can be specialized.
233
+ static bool canBeSpecialized (ApplySite Apply, SILFunction *Callee,
234
+ SubstitutionList ParamSubs);
222
235
};
223
236
224
237
// / Helper class for specializing a generic function given a list of
Original file line number Diff line number Diff line change @@ -316,8 +316,7 @@ SILFunction *SILPerformanceInliner::getEligibleFunction(FullApplySite AI) {
316
316
// specialization for a given call.
317
317
static bool canSpecializeGeneric (ApplySite AI, SILFunction *F,
318
318
SubstitutionList Subs) {
319
- ReabstractionInfo ReInfo (AI, F, Subs);
320
- return ReInfo.canBeSpecialized ();
319
+ return ReabstractionInfo::canBeSpecialized (AI, F, Subs);
321
320
}
322
321
323
322
bool SILPerformanceInliner::isProfitableToInline (FullApplySite AI,
You can’t perform that action at this time.
0 commit comments