Simon Peyton-Jones wrote:
GHC does some constant folding, but little by way of strength reduction, or 
using shifts instead of multiplication.  It's pretty easy to add more: it's all 
done in a single module.  Look at primOpRules in the module PrelRules.

Although it isn't done at the Core level as Simon says, GHC's native code generator does turn multiplies into shifts, amongst various other low-level optimisations. In fact it's not clear that this kind of thing *should* be done at a high level, since it's likely to be machine-dependent.

Cheers,
        Simon
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to