Merge pull request #82800 from eeckstein/fix-metatype-in-mpo-6.2

[6.2] MandatoryPerformanceOptimizations: don't specialize vtables for thin class metatype instructions
This commit is contained in:
eeckstein
2025-07-07 16:05:22 +02:00
committed by GitHub
2 changed files with 44 additions and 1 deletions

View File

@@ -122,7 +122,8 @@ private func optimize(function: Function, _ context: FunctionPassContext, _ modu
}
}
case let metatype as MetatypeInst:
if context.options.enableEmbeddedSwift {
if context.options.enableEmbeddedSwift,
metatype.type.representationOfMetatype == .thick {
let instanceType = metatype.type.loweredInstanceTypeOfMetatype(in: function)
if instanceType.isClass {
specializeVTable(forClassType: instanceType, errorLocation: metatype.location, moduleContext) {