Changes between Version 9 and Version 10 of Commentary/Libraries/Integer


Ignore:
Timestamp:
Jul 13, 2012 9:30:42 PM (21 months ago)
Author:
simonpj
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/Libraries/Integer

    v9 v10  
    2929 * '''Constant folding'''.  There are many constant-folding optimisations for `Integer` expressed as built-in rules in [[GhcFile(compiler/prelude/PrelRules.lhs)]]; look at `builtinIntegerRules`.  All of the types and functions in the `Integer` interface have built-in names, e.g. `plusIntegerName`, defined in [[GhcFile(compiler/prelude/PrelNames.lhs)]] and included in `basicKnownKeyNames`. This allows us to match on all of the functions in `builtinIntegerRules` in [[GhcFile(compiler/prelude/PrelRules.lhs)]], so we can constant-fold Integer expressions. 
    3030 
    31  * '''Converting between Int and Integer'''.  It's quite commonly the case that, after some inlining, we get something like `integerToInt (intToInteger i)`, which converts an `Int` to an `Integer` and back.  This ''must'' optimise away.  We do this by requiring that the `integer` package exposes 
     31 * '''Converting between Int and Integer'''.  It's quite commonly the case that, after some inlining, we get something like `integerToInt (intToInteger i)`, which converts an `Int` to an `Integer` and back.  This ''must'' optimise away (see #5767).  We do this by requiring that the `integer` package exposes 
    3232{{{ 
    3333  smallInteger :: Int# -> Int