tools for comparing ghc's debug outputs?

Claus Reinke claus.reinke at talk21.com
Thu Jul 31 04:14:51 EDT 2008


What tools are there for facilitating comparisons of ghc's
debug output? I have reduced a performance problem in 
my code to a case where switching two lines of code doubles
or halves the performance (the results of those lines are stored
in record fields that never get used in this reduced example..,
see ghc trac ticket #2463). 

So it should be easy to take the outputs of -ddump-simpl, 
etc. for both variants and run them through a diff viewer,
but there are way too many irrelevant differences and details.

I seem to recall someone mentioning a tool for normalizing
the output of things like -ddump-simpl to make diffs easier
by reducing irrelevant differences due to gensym-generated
names. Was that just wishful thinking, or does such a thing 
exist?-)

Also, it might be useful if one could translate the transformed
code back to highlevel (ghc-)Haskell that would generate the
same low-level code (ie, pretending that the source-to-source
transformations actually happened at source level). Not only
would that blend out irrelevant details, it would also give a
direct indication of how to modify the source to get better
performing code.

What tools are there, and which do you use/recommend
for tasks like this?

Thanks,
Claus



More information about the Glasgow-haskell-users mailing list