mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Reduce array abstraction on apple platforms dealing with literals (#13665)
* Reduce array abstraction on apple platforms dealing with literals Part of the ongoing quest to reduce swift array literal abstraction penalties: make the SIL optimizer able to eliminate bridging overhead when dealing with array literals. Introduce a new classify_bridge_object SIL instruction to handle the logic of extracting platform specific bits from a Builtin.BridgeObject value that indicate whether it contains a ObjC tagged pointer object, or a normal ObjC object. This allows the SIL optimizer to eliminate these, which allows constant folding a ton of code. On the example added to test/SILOptimizer/static_arrays.swift, this results in 4x less SIL code, and also leads to a lot more commonality between linux and apple platform codegen when passing an array literal. This also introduces a couple of SIL combines for patterns that occur in the array literal passing case.
This commit is contained in:
@@ -1384,6 +1384,7 @@ void EscapeAnalysis::analyzeInstruction(SILInstruction *I,
|
||||
case SILInstructionKind::DeallocRefInst:
|
||||
case SILInstructionKind::SetDeallocatingInst:
|
||||
case SILInstructionKind::FixLifetimeInst:
|
||||
case SILInstructionKind::ClassifyBridgeObjectInst:
|
||||
// These instructions don't have any effect on escaping.
|
||||
return;
|
||||
case SILInstructionKind::StrongReleaseInst:
|
||||
|
||||
Reference in New Issue
Block a user