3 ms·
Yeah, it goes to show that you really want a mid-level language-specific IR (which is what the Plan 9-based compilers have) if your language is at all high leve
by pcwalton 11y ago
Yeah, it goes to show that you really want a mid-level language-specific IR (which is what the Plan 9-based compilers have) if your language is at all high level.
I think the ideal for best performance of generated code is 3 IRs: a mid-level language-specific IR for high-level optimizations (especially around memory management and devirtualization), a low-level IR for lower-level optimizations (e.g. algebraic simplifications), and a codegen IR (for instruction selection and scheduling). This is what Swift is doing, as far as I can tell.