Specializing certain generic Swift types and functions (for bare metal)

There's no reason we shouldn't be able to monomorphize that call site, as long as the initializer is indeed showing up as inlinable with its body in the standard library swiftinterface file. We should make it inlinable in the real standard library if it isn't. Is your build picking up the updated swiftinterface and swiftmodule for the library when you make those changes locally? And are you building with -O? I believe @inline(__always) is still not inlined in -Onone mode. A robust "bare metal" Swift environment more than likely needs help from the compiler to require transformations that eliminate possibly-allocating operations. You might try adding a compiler mode that enforces the @noLocks mode by default across all code.

5 Likes