Simplified and HTML lowered statement dumps

Initial import, adaptation, and cleanup of statement simplification, HTML dump. Original code by @zingales. This needs a review.
The difference is that line 488 is
A) implemented inline, so the function actually exists. This is necessary
for the template version to work.
B) it only exists because it has different semantics to the buffer version
(it also does a copy_to_host)


On Mon, Jul 28, 2014 at 11:26 AM, Giuseppe Zingales <
notifications@github.com> wrote:

> In src/Func.h:
>
> >                                          const Target &target = get_target_from_environment());
> >
> > +    /** Write out an internal representation of lowered code as above
> > +     * but simplified using the provided realization bounds and other
> > +     * concrete parameter values. Emits HTML if the filename ends in
> > +     * .html, plain text otherwise. */
> > +    EXPORT void compile_to_simplified_lowered_
> stmt(const std::string &filename,
> > +                           Realization dst, std::map<std::string, Expr> additional_replacements,
> > +                           StmtOutputFormat fmt = Text,
> > +                           const Target &t = get_target_from_environment());
> > +
> > +    EXPORT void compile_to_simplified_lowered_stmt(const std::string &filename,
> > +                           Realization dst,
> > +                           StmtOutputFormat fmt = Text,
> > +                           const Target &t = get_target_from_environment());
> > +
> > +    template<typename T>
>
> As mentioned previously, the compile_to_simplified _lowered_stmt
> overloaded method calls were created to mirror the Func::realize overloaded
> method calls as close as possible. For this reason I do not feel
> comfortable changing it to Buffer.
>
> On the issue of template, I used the exact same template structure as is
> used in Func.h:488. If the use is reasonable in one situation I do not
> understand the difference.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/halide/Halide/pull/389/files#r15480552>.
>