From: Charles Z. <ka...@be...> - 2018-08-14 02:10:52
|
Hello Bruno, I've updated the README to point to the reader where to find more about Cleavir. The buildable document should bring you up to speed about what HIR is and most of everything else about Cleavir. I don't think edge split graph is what is meant by the thesis in that link. I mean edge split graph to come from the process of edge splitting following the axiomatic definition I gave, which is described in compiler texts like Appel. I wrote a comment describing unphi. It's an approach I made up to convert SSA to a stack machine. Also, the whole CST-to-AST and Generate-AST issue is a little complicated and a long story. Robert Strandh has deprecated Generate-AST which also has some closure conversion bugs. I discovered the bug is also present in CST-to-AST but just brushed under the rug. I went ahead and fixed it but it required a bunch of changes to CLISP to support the proper fix to the bug, allowing me to reduce the number of closures allocated. To make things more complicated, that pull request hasn't been merged yet and still needs to be tested by Clasp. In summary, things should be working and only using CST-to-AST once the pull request is merged, which should be soon. The graph-form tool is fairly simple. You invoke it on a quoted lambda form and it should draw the optimized HIR graph in GraphViz for you. It is a great way of getting familiar with HIR, the flow graph IR which gets translated to CLISP. The optimization function is specified by the keyword optimize-fun. You can learn about catch/unwind and its weirdness from the Cleavir doc (if its been updated, it was recently redesigned in June). It's the HIR way of representing non-local exits. Value numbering was a prototype value numbering pass I wrote to test removing redundant computations like in (+ (* x y) (* x y)). I abandoned it to work on more pressing issues I found with correctness and closures. Charles On Sun, Aug 12, 2018 at 10:23 PM, Bruno Haible <br...@cl...> wrote: > Hi Charles, > > Thank you for having added file-level comments to the files. > These comments are very useful, because I wouldn't have guessed > these things. > > The comment I loved most is how to make the compiler self-hosting > (in README) - never guessed it would be so easy. > > But there are more things that comments could explain: > > - Where is readable documentation about the SICL terms? For example, > while I know that IR means "internal representation", 'HIR' is > unknown to me. > > - What is unphi for? What does the unphi-instruction stand for? > > - Is the "edge-split graph" the same thing as defined in > Definition 2.11 of > https://dspace.library.uu.nl/bitstream/handle/1874/336410/thesis.pdf ? > You seem to use an axiomatic definition of "edge-split graph" instead? > > - What are the differences between CST and AST? Why does using CST help > reducing the number of cells of closure vectors? > > - What do you mean with "cells are stuck in the strange > structure of catch-unwind branches"? Can you add an example > (as source code or IR or byte code, I don't know)? > > - When and how do you use graph-form in tools.lisp? What insights does > it bring? > > - What is value-numbering.lisp about? > > Bruno > |