mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[SILOptimizer] Add prespecialization for arbitray reference types (#58846)
* [SILOptimizer] Add prespecialization for arbitray reference types * Fix benchmark Package.swift * Move SimpleArray to utils * Fix multiple indirect result case * Remove leftover code from previous attempt * Fix test after rebase * Move code to compute type replacements to SpecializedFunction * Fix ownership when OSSA is enabled * Fixes after rebase * Changes after rebasing * Add feature flag for layout pre-specialization * Fix pre_specialize-macos.swift * Add compiler flag to benchmark build * Fix benchmark SwiftPM flags
This commit is contained in:
@@ -82,6 +82,7 @@ public:
|
||||
|
||||
static SILSpecializeAttr *create(SILModule &M,
|
||||
GenericSignature specializedSignature,
|
||||
ArrayRef<Type> typeErasedParams,
|
||||
bool exported, SpecializationKind kind,
|
||||
SILFunction *target, Identifier spiGroup,
|
||||
const ModuleDecl *spiModule,
|
||||
@@ -107,6 +108,14 @@ public:
|
||||
return specializedSignature;
|
||||
}
|
||||
|
||||
GenericSignature getUnerasedSpecializedSignature() const {
|
||||
return unerasedSpecializedSignature;
|
||||
}
|
||||
|
||||
ArrayRef<Type> getTypeErasedParams() const {
|
||||
return typeErasedParams;
|
||||
}
|
||||
|
||||
SILFunction *getFunction() const {
|
||||
return F;
|
||||
}
|
||||
@@ -133,6 +142,8 @@ private:
|
||||
SpecializationKind kind;
|
||||
bool exported;
|
||||
GenericSignature specializedSignature;
|
||||
GenericSignature unerasedSpecializedSignature;
|
||||
llvm::SmallVector<Type, 2> typeErasedParams;
|
||||
Identifier spiGroup;
|
||||
AvailabilityContext availability;
|
||||
const ModuleDecl *spiModule = nullptr;
|
||||
@@ -140,8 +151,11 @@ private:
|
||||
SILFunction *targetFunction = nullptr;
|
||||
|
||||
SILSpecializeAttr(bool exported, SpecializationKind kind,
|
||||
GenericSignature specializedSignature, SILFunction *target,
|
||||
Identifier spiGroup, const ModuleDecl *spiModule,
|
||||
GenericSignature specializedSignature,
|
||||
GenericSignature unerasedSpecializedSignature,
|
||||
ArrayRef<Type> typeErasedParams,
|
||||
SILFunction *target, Identifier spiGroup,
|
||||
const ModuleDecl *spiModule,
|
||||
AvailabilityContext availability);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user