Where can I stick a dead code elimination rule for quotRemInt#?

David Feuer david.feuer at gmail.com
Fri Sep 19 23:33:55 UTC 2014


As I describe in #9617, GHC's CSE in 7.9 seems to be good enough to let Int
and Integer use

quot x y = fst (x `quotRem` y)
rem x y = snd (x `quotRem` y)

And actually get good results in code that uses both the quotient and the
remainder. I believe the only thing left to be able to actually implement
this is a simple rule to turn a match on quotRemInt# into one on quotInt#
or remInt# if only the quotient or only the remainder is used. My question
is where I could stick such a rule. Can anyone advise me? All I know is
that it has to happen after CSE.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20140919/12e7f217/attachment.html>


More information about the ghc-devs mailing list