6 ms·
Excellent article! One thing I'm curious about: LLVM uses phi, as was considered best practice at the time. Of late, some people have started using block parame
by rwallace 5y ago
Excellent article! One thing I'm curious about: LLVM uses phi, as was considered best practice at the time. Of late, some people have started using block parameters instead; they are fundamentally equivalent, but make some operations more convenient at the cost of making other operations less convenient. Do the LLVM developers still consider phi the best choice, or would block parameters look better if you had it to do over?
- Mathnerd314 5y agoWell, MLIR uses block parameters: https://mlir.llvm.org/docs/Rationale/Rationale/#block-arguments-vs-phi-nodes https://mlir.llvm.org/docs/Rationale/Rationale/#block-argume... That could just be a Chris Lattner thing, but he's one of the main LLVM developers, so...
- moonchild 5y agoNot an LLVM developer, but I've given my thoughts at [1]. The QBE developer agrees fwiw[2], and there is some other interesting discussion in that thread, in particular comparing block parameters to CPS. (Which I think is appropriate for a functional-language compiler, but makes less sense for an imperative-language compiler which must manage mutability and which tends to be less focused on interprocedural optimizations.) 1. https://groups.google.com/g/comp.compilers/c/73kOI_S7r5A https://groups.google.com/g/comp.compilers/c/73kOI_S7r5A. (Sorry for g groups link; comp.compilers website mangles unicode—my fault—and narkive doesn't seem to have the post.) 2. https://www.reddit.com/r/Compilers/comments/5tq6mo/a_common_flaw_in_ssa_intermediate_representations/ddouldu/ https://www.reddit.com/r/Compilers/comments/5tq6mo/a_common_...