Hi Phil,

Try this:

( scratchpad ) USE: optimizer.debugger
( scratchpad ) [ [ drop ] each ] f optimized-quot.
[
    dup length swap 0 -rot \ G:1872514 [
        pick pick < [
            swap
            >r 2dup
            >r
            >r drop drop r>
            r>
            r>
            swap
            >r
            >r 1+ r>
            r>
            G:1872514
        ] [ 3drop ] if
    ] call
]

Note that stack shuffles are coalesced at a later stage of the compile 
process, after IR optimization.

Slava

Phil Dawes wrote:
> Hi Slava, Hi Factor List,
>
> I was wondering, what do you use for prettyprinting/visualising IR graphs?
> I'd like to write some tight loop code in factor rather than C, and want 
> to get better view of how factor is compiling the code.
>
> I've found that in addition to using tools.disassembler after the code 
> is compiled, I can take the code through the various stages thus:
>
> USING: compiler optimizer generator ;
>
> 1) Getting basic dataflow
>
> \ myword word-dataflow pprint
>
> 2) Getting optimized dataflow
>
> \ myword word-dataflow optimize pprint
>
> 3) Getting machine code:
>
> \ myword word-dataflow optimize H{ } clone
> [ compiled set \ myword dup generate ] keep pprint
>
> However I currently lack a way of visualising the IR dataflow to easily 
> see what's going on. I could hack something up, but was wondering if 
> there was already something I could use?
>
> Actually a more general question: are there any other tips and tricks 
> that might help make the compilation process more transparent?
>
> Many thanks,
>
> Phil
>
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Factor-talk mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
>   


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to