<div dir="ltr">GHC has certain rules builtin for simplifying expressions wrt various primops<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 28, 2014 at 4:40 PM, Dominik Peteler <span dir="ltr"><<a href="mailto:haskell@with-h.at" target="_blank">haskell@with-h.at</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear Cafe,<br>
<br>
I'm currently looking at the optimization GHC is doing and I cannot find<br>
the rewrite rules it fires. When I run my test code with<br>
<br>
    ghc -O2 -ddump-simpl-stats -ddump-rule-firings Main.hs<br>
<br>
GHC shows the rules which are fired:<br>
<br>
    ...<br>
    Rule fired: Class op +<br>
    ...<br>
    Rule fired: +##<br>
    ...<br>
<br>
and so on. Nothing new, nothing special.<br>
However, where do I find the definitions of these rules ?<br>
I grepped[1] the GHC code base and found nothing so far. I didn't find any<br>
documentation on it either.<br>
<br>
Can anyone point me to some place where I can find further information ?<br>
<br>
Thank you folks and have a nice day<br>
<br>
Dominik<br>
<br>
PS.: Since I'm working on numerical stable code with directed rounding<br>
I'm only interested in these two particular rules. I suspect them to<br>
break parts of my code.<br>
<br>
[1] <a href="http://jamie-wong.com/2013/07/12/grep-test" target="_blank">http://jamie-wong.com/2013/07/12/grep-test</a><br>
<br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br></div>