SIL for First Time Learners
updated 10 months ago
Swift compiler runs in multiple phases and one of the biggest one is SIL optimizations. SIL stands for Swift Intermediate Language and the reason why Swift compiler has SIL which is its own intermediate representation between AST and LLVM IR is that it performs so many Swift-specific optimizations like
witness and vtable devirtualization and so on.
In Swift 4.1, Swift compiler supports a new optimization mode which is
-Osize and we now have many options for optimizations. So I believe that it’s quite valuable to know what SIL is for and how it works as Swift developer.
These are major benefits from learning SIL.
- Better idea of how Swift type system works
- Detailed knowledge of swift specific optimizations
- Understanding about what Swift compiler does
In this talk, we’ll go over basic idea of SIL with simple examples. I'll also highlight what kind of optimizations run over.