Questions tagged [intermediate-representation]

Filter by
Sorted by
Tagged with
1 vote
0 answers
75 views

How to serialize IR with cross references?

When I type check, I generate IR and serialize them to avoid retypechecking of libraries, which is usually unchanged after the first compilation. However, I store these variable references using ...
ice1000's user avatar
  • 2,384
9 votes
1 answer
902 views

What are the tradeoffs between using sea of nodes, CFG of basic blocks, and egraphs for compiler optimizations?

I've heard of "sea of nodes" intermediate representations mostly in the context of just-in-time compilation (JVM, V8, Graal) whereas intermediate representations such as LLVM IR are used in ...
Troy Sargent's user avatar
10 votes
3 answers
873 views

Can you, should you, go straight from AST to SSA?

I'm beginning to read Appel's book Modern Compiler Implementation in C. The book is about 25 years old, so maybe it's not so "modern" anymore, I don't know. I'm skimming the book and it ...
Rob N's user avatar
  • 1,073
10 votes
2 answers
450 views

What are the disadvantages of using CPS form?

Motivation CPS(Continuation-Passing Style), SSA(Static Single Assignment), ANF(A-Normal Form) are three common forms of IR(Intermediate Representation). I find it very convenient to describe and ...
Aster's user avatar
  • 2,688
14 votes
0 answers
423 views

What is the relationship between STG and RVSDG?

GHC is an optimizing Haskell compiler. Since Haskell is lazy and mutation is rare, control flow and data flow are often very closely aligned. Therefore, it is often most useful to think about ...
Alexis King's user avatar
  • 8,026
9 votes
3 answers
523 views

What are the disadvantages of using SSA form?

SSA form is common intermediate representation used in compilers where all variables are assigned to exactly once. It greatly helps with a myriad of optimizations, such as constant folding, dead code ...
Seggan's user avatar
  • 2,603
11 votes
2 answers
273 views

What are the pros and cons of transpiling to a high-level language vs compiling to VM bytecode or LLVM IR

From Wikipedia: A source-to-source translator, source-to-source compiler (S2S compiler), transcompiler, or transpiler is a type of translator that takes the source code of a program written in a ...
justANewbie's user avatar
10 votes
1 answer
152 views

Is Cmm suitable for use in compilers besides GHC?

Cmm is a fork of C-- used by GHC for codegen. I was previously thinking of using LLVM but Cmm seems to be a nicer, easier way to go.
a coder's user avatar
  • 685