Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm writing an optimizer for a language similar to JavaScript, and need to choose an intermediate code representation. The obvious/typical choice these days is Static Single Assignment (SSA).

However, Modern Compiler Implementation in C also discusses functional intermediate form, which basically means going pure functional for the intermediate representation (pure in terms only of local variables, heap data is still mutable, and not CPS, just straightforward let blocks and tail calls) and has some advantages in terms of being easier to reason about.

Presumably it's not a no-brainer or everyone would already be using such a representation, so my question is, what disadvantages does functional intermediate form have compared to SSA?

share|improve this question
1  
What kind of analysis you're going to do upon this intermediate form? SSA is great for dead code elimination, constant propagation, partial specialisation and such. If this kind of stuff is not on your menu, you can skip SSA and use a more relaxed representation for simpler analysis passes. But, generating an SSA form is quite a trivial task, and you can easily convert SSA into CPS (and vice versa), which doubles the benefits. –  SK-logic Jun 1 '13 at 16:35
    
Yeah, I'm aiming for the full monty, pretty much, and the input language and output format (initially C++) are both imperative languages. –  rwallace Jun 2 '13 at 2:30
    
Generating an SSA form is quite a trivial task, and you can easily convert SSA into CPS, also you can convert CPS to SSA, which doubles the benefits. –  Leon Alexis Cardinal Aug 7 '13 at 6:32

1 Answer 1

up vote 1 down vote accepted

SSA is great for dead code elimination, constant propagation, partial specialisation and such. If this kind of stuff is not on your menu, you can skip SSA and use a more relaxed representation for simpler analysis passes

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.