Skip to content

Commit 51792d8

Browse files
committed
[embedded] Simplify optimizeArrayBuiltin, avoid needing a single use of the metatype inst
1 parent d061b93 commit 51792d8

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyBuiltin.swift

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,15 +179,10 @@ private extension BuiltinInst {
179179
return
180180
}
181181

182-
// Must be single use so that we can use replaceAll
183-
guard metatypeInst.uses.isSingleUse else {
184-
return
185-
}
186-
187182
let instanceType = metatypeInst.type.instanceTypeOfMetatype(in: parentFunction)
188183
let builder = Builder(before: self, context)
189184
let metatype = builder.createMetatype(of: instanceType, representation: .Thin)
190-
metatypeInst.uses.replaceAll(with: metatype, context)
185+
operands[0].set(to: metatype, context)
191186
}
192187
}
193188

0 commit comments

Comments
 (0)