Discussion on Simple and Efficient Construction of Static Single Assignment Form #593
Replies: 17 comments 1 reply
-
|
Critique: I also like how their algorithm doesn’t rely on extra passes or transformations to produce a minimal and pruned SSA. Still, I wonder if that doesn't go against compiler engineering principles: shouldn’t we aim for modular, independent passes? For example, they handle dead code elimination of phi-functions inside the algorithm itself, but DCE is an independent pass that doesn't just apply for SSA, so it could be reused and run after SSA. This makes me question if having it inside SSA construction really simplifies things or just blurs the boundaries between passes. Question: |
Beta Was this translation helpful? Give feedback.
-
CritiqueThis paper introduces a novel algorithm for constructing SSAs. This new algorithm is a lazy and backward algorithm – when a variable is used, the algorithm backtracks to find its reaching definitions, caching results to avoid duplicated computation. I appreciated that the authors of this paper compared this new SSA algorithm with Cytron. However, I feel that the paper could have spent more time discussing evaluation results. The researchers could have built a more systemic understanding of the benefits/drawback of this new algorithm if they had extended the test suite to also include other hardware architectures (RISC instead of CISC). Additionally, I also wish they included metrics regarding compilation time for comparisons between this new algorithm and Cytron. Questions
|
Beta Was this translation helpful? Give feedback.
-
|
Critique: Question: |
Beta Was this translation helpful? Give feedback.
-
|
The paper was interesting. While the technique was over my head, the supporting evidence appears to suggest that it is sound, and generally yields some performance result (especially on the compiler performance side). I do wonder if, considering that the paper was discussing an earlier version of LLVM, and the authors do actually modify it, if their changes were ever upstreamed, and if LLVM uses this approach today. I also wonder if there is any memory penalty associated with the approach; and if the resutls produced with on-the-fly optimisations are necessarily more performant programs (if they are possibly a premature optimisation) As for discussion question(s):
|
Beta Was this translation helpful? Give feedback.
-
|
Critique Question |
Beta Was this translation helpful? Give feedback.
-
|
Critique: Questions: |
Beta Was this translation helpful? Give feedback.
-
|
Critique It reads to me like the main benefit of the SSA construction algorithm presented in this paper is that it avoids the intermediate CFG construction and dominance relation/dominance frontier analysis required by the Cytron et al. algorithm. I don't know that I would characterize the algorithm and its presentation as "simple"; I found it somewhat hard to parse. In particular, I concur with @SerenaYZhang that I'm not totally clear on how some parts work without a pre-computed CFG, e.g. section 2.2. I'll take the proofs at face value, but I'm also somewhat skeptical of the evaluation; it is absolutely not comprehensive and gives little context as to why the results are what they are, and why we should care. Questions Pros and cons of this algorithm versus the Cytron et al. algorithm? How do they compare in terms of readability and performance on workloads of interest? Why choose one over the other? |
Beta Was this translation helpful? Give feedback.
-
|
Critique: The paper's proposal - a backward SSA algorithm that doesn't use the dominance frontier - seems quite interesting! It naturally yields a "pruned" SSA and allows for optimizations during IR construction. Strong points: conceptually simple, awesome theoretical work (proof of minimality e.g) and presented evidence that compares it with LLVM's algorithm (Cytron et al). One slightly confusing aspect is the layering of phi-handling strategies (trivial phi removal, SCC contraction, marker algorithm); this makes it difficult to separate the core SSA construction from the optimization passes. Question: Is the backward construction affected in any way by highly irregular control flow, perhaps in ways that are not as impactful for Cytron et al's algorithm? I'm specifically thinking of programs with complex control flow (like a lot of nested loops), where recursion and delayed phi placement could add overhead. |
Beta Was this translation helpful? Give feedback.
-
|
Critique: This paper introduces a backward algorithm for building Static Single Assignment (SSA). It aims to make SSA construction easier by generating it directly, rather than relying on separate analyses such as dominance frontiers. Unlike the older Cytron et al. method, it doesn’t require constructing a control flow graph first, which could make it faster and simpler. While the idea seems efficient, I would like to see how well the method performs on large or real-world programs through concrete examples and evaluations. Overall, the approach appears promising, but I wonder whether it has been widely adopted in real compilers. Questions: Has this SSA algorithm been used in any modern compilers? What further developments or improvements have been made since then? |
Beta Was this translation helpful? Give feedback.
-
|
Critique: Question: |
Beta Was this translation helpful? Give feedback.
-
CritiqueProgramming languages research often fascinates me because it blends formal reasoning with tangible system impact. Many papers in this field are deeply theoretical and proof driven, yet they frequently lead to techniques used in real compilers. This paper is a great example; it does not just propose a new SSA construction algorithm, it actively demonstrates how it integrates into real compilation pipelines. I appreciate that it grounds the discussion in practical compiler construction rather than staying abstract. One small critique I have is that while the authors emphasize that their approach avoids dominance and liveness analyses, the resulting algorithm still involves recursive lookups and phi placement logic whose complexity can grow with control flow and variable count. I wonder whether the practical benefits of avoiding explicit dominance computation truly outweigh the implicit cost of these global traversals, especially in large or irregular programs. Discussion QuestionThe authors argue that their algorithm’s ability to interleave SSA construction with on the fly optimizations is a key strength. Could performing optimizations this early in the pipeline ever interfere with later, more global optimizations, or is earlier simplification always a win in practice? |
Beta Was this translation helpful? Give feedback.
-
|
Critique: In the time complexity analysis, I saw the SCC construction looks like it can get quite expensive. In particular, the Question: I saw @pedropontesgarcia and @magg1egao mentioned this a bit, but I want to drill in on it: my understanding of the algorithm is that by design it requires optimizations to occur inline with CFG construction. The authors mention that simple optimizations based on single basic blocks can be preformed during construction, and of course analyses can be applied after. However, I wonder if there are global analyses which would benefit from being performed prior to the SSA CFG construction which now become impossible to do? |
Beta Was this translation helpful? Give feedback.
-
|
Critique: I thought the property section of the paper was the most interesting, especially minimal SSA form. The paper goes into great depth on proving the algorithm produces an intermediate in this form. Thus, the algorithm is proven to be, in at least some form, optimal, in that it contains no trivial phi functions and has singular definitions for each variable. Question: The authors mix average time and worst time complexity heavily in their analysis. Is there an advantage to this level of disparate analysis, especially given that the conclusion to that section still uses worst time complexity? |
Beta Was this translation helpful? Give feedback.
-
|
Critique: This paper presents a really elegant solution to creating SSAs. It reminds me of a more DP approach. I wish the paper made more comparisons about what properties of certain benchmarks made the Marker to Cytron's algorithm instruction ratio higher, and what general properties of a program makes the SSA builder excel. Question: I saw @adnan-armouti mention this as well and I was wondering the same thing. The condition that this simple algorithm works on reducible CFG and other post-processing algorithms must be applied to it if it's not reducible seems to be a pretty good explanation for why different benchmarks perform comparably or worse for the proposed algorithm. I wonder if there are other insights into program structures that do better with this DP-like approach, and how could we take advantage of different programming languages structure to further optimize this algorithm? |
Beta Was this translation helpful? Give feedback.
-
|
Critique The paper introduces a lazy approach to SSA construction that produces a minimal, pruned SSA form. The algorithm also supports incomplete CFGs, making it applicable during the translation from AST to IR. The paper discusses several optimizations aimed at reducing the number of inserted Questions
|
Beta Was this translation helpful? Give feedback.
-
Discussion: A Lazy Take on Building SSAThis paper proposes a really neat alternative to the classic Cytron et al. algorithm for building SSA. Instead of computing dominance frontiers and placing φ-nodes eagerly, they flip the process around — it’s lazy and backwards. Whenever a variable is used, the algorithm searches backwards through the CFG to find its reaching definition, inserting φ-functions only when necessary. It also handles incomplete CFGs (like when you’re still building the IR from an AST) by using a concept called sealing — blocks are “sealed” once all their predecessors are known. This makes it possible to build SSA directly from high-level structures like ASTs or bytecode, without detouring through a non-SSA CFG first. Another cool part is that it performs on-the-fly optimizations (constant folding, copy propagation, etc.) during construction. Because it’s already in SSA form, some optimizations can happen immediately, sometimes even reducing φ-nodes below what Cytron’s “minimal” SSA would produce. In the evaluation, they implemented it in LLVM and found it just as fast as the traditional approach — sometimes faster when you include those early optimizations. It’s also great for JIT compilers or for reconstructing SSA after transformations like jump threading. What I liked most is how conceptually simple it is: it treats SSA construction almost like variable lookup with memoization instead of a heavy analysis pass. It feels more intuitive, especially if you’re used to functional or recursive program structures. Things I’m wondering:
|
Beta Was this translation helpful? Give feedback.
-
|
Critique: This paper presents an alternative SSA-construction algorithm that enables direct transformation from AST or bytecode into pruned SSA format, without the need for building dominance trees and dominance frontiers like in Cytron et al. The algorithm appears to work well when the control flow is reducible, but for irreducible control flow it may insert extra phi nodes, and cleanup could be non-trivial. I also found the proof to be quite challenging to understand. However, I still think this is really cool. Question: I'm curious about the real-world performance of this algorithm. Do on-the-fly operations cancel out the benefits of fewer phi nodes? I guess it's a compiler, so you can afford to take more time to generate a better binary. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Discussion thread for: Simple and Efficient Construction of Static Single
Assignment Form
Discussion leads: @natetyoung, @arw274, @SolidLao, @NingWang0123, Eddie Chen
Beta Was this translation helpful? Give feedback.
All reactions