đź“ťSwift Intermediate Language (SIL)

SIL is a Swift Intermediate Language, an intermediate representation of Swift that sits between AST and LLVM IR.

It is very similar to LLVM IR but is higher level and Swift-specific. It preserves more source language information (types).

Notable features:

  • High-level type system (including generics)
  • Constants are instructions. No Value/Constant divide. There is a place to attach source information to literals, etc.
  • No phi nodes. Instead, basic blocks receive arguments.
  • SIL does not know about objects’ layout—this is handled by LLVM IR lowering.



Want to receive my đź–‹ posts as I publish them?