mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
* 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.
3.8 KiB
3.8 KiB