Put asserts in a block, pulled Lets out into LetStmts.

A bit of improvement to the HTML output:

- Contiguous asserts get moved into a collapsible block.
- Lets are moved into LetStmts. 

These transformations are not returned, the IR transformations are only used for HTML output.
I like the idea of a CommentBlock IR node. It could be useful for debugging
too: you put one around the IR the code you are working on is generating to
make it easier to see in the Stmt. In fact, if it could have multiple
Expr's of debug content, it could be like a printf that gets carried with
the IR. (Noting that the values in the IR won't get mutated, but I suppose
one could reference Let values....)

I think it is an easy change to the IR as it should be possible to handle
all mutations with the default mutator that just visits the children...


On Fri, Sep 19, 2014 at 1:30 PM, Dillon Sharlet <notifications@github.com>
wrote:

> In src/StmtToHtml.cpp:
>
> > @@ -21,6 +22,76 @@ std::string to_string(T value) {
> >      return os.str() ;
> >  }
> >
> > +// Prepares a Stmt for printing in HTML:
>
> I thought about it, but the thing I do here to identify the block as a
> block of asserts is pretty hacky/ugly, I'm not sure we should add it to the
> IR in general.
>
> What do you guys think about adding a new IR node "CommentBlock"? It would
> have a string representing the comment, and a Stmt child that the comment
> applied to (could be NULL).
>
> If we had that IR node, I would modify codegen to generate the asserts
> directly into a CommentBlock IR node.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/halide/Halide/pull/475/files#r17807513>.
>