Changes between Version 40 and Version 41 of DataParallel/ClosureConversion/ClassLess


Ignore:
Timestamp:
May 1, 2007 4:29:26 AM (8 years ago)
Author:
chak
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DataParallel/ClosureConversion/ClassLess

    v40 v41  
    1717 * `ConvCC convDecl`: The variant `convDecl` is the closure-converted form of `thisDecl`.
    1818An example of a feature that prevents conversion are unboxed values.  We cannot make a closure from a function that has an unboxed argument, as we can neither instantiate the parametric polymorphic closure type with unboxed types, nor can we put unboxed values into the existentially quantified environment of a closure.
     19
     20'''TODO:''' We won't really store `StatusCC` in `TyCon`s, `DataCon`s, and `Id`s, but instead have three finite maps maintaining the same information.
    1921
    2022=== Conversion pairs ===
     
    184186{{{
    185187T^            = T_CC , if tyConCC T == ConvCC T_CC
    186                 T    , otherwise
    187 a^            = a   
     188              = T    , otherwise
     189a^            = a
     190(t1 -> t2)^   = t1^ -> t2^ , if kindOf t1 == #
     191                             or kindOf t2 == #
     192              = t1^ :-> t2^, otherwise
    188193(t1 t2)^      = t1^ t2^
    189194(forall a.t)^ = forall a.t^
    190195}}}
    191 
     196Here some examples,
     197{{{
     198(Int -> Int)^           = Int :-> Int
     199(forall a. [a] -> [a])^ = [a] :-> [a]
     200([Int -> Int] -> Int)^  = [Int :-> Int] :-> Int
     201(Int# -> Int# -> Int#)^ = Int# -> Int# -> Int#
     202((Int -> Int) -> Int#)^ = (Int :-> Int) -> Int#
     203(Int -> Int -> Int#)^   = Int :-> (Int -> Int#)
     204}}}
     205
     206=== Converting value bindings ===
     207
     208==== Bindings ====
     209
     210==== Toplevel ====
     211
     212When converting a toplevel binding for `f :: t`, we generate `f_CC :: t^`. 
     213
     214
     215The alternatives `GlobalId` and `LocalId` of `Var.Var` get a new field `idCC :: StatusCC Id` whose values, for a declaration `f`, we determine as follows:
     216 * If `Id`'s declaration uses any features that we cannot (or currently, don't want to) convert, set `idCC` to `NoCC`.
     217 * If all type constructors involved in `f`'s type are marked `NoCC` or `AsIsCC`, we set `f`'s `idCC` field to `AsIsCC`.
     218 * Otherwise, convert `f` and set its `ifCC` field to `ConvCC f_CC`.
    192219
    193220----
    194221chak: revision front
    195222----
    196 
    197 
    198 
    199 === Converting value bindings ===
    200 
    201 When converting a toplevel binding for `f :: t`, we generate `f_CC :: t^`.  The alternatives `GlobalId` and `LocalId` of `Var.Var` get a new field `idCC :: StatusCC Id` whose values, for a declaration `f`, we determine as follows:
    202  * If `Id`'s declaration uses any features that we cannot (or currently, don't want to) convert, set `idCC` to `NoCC`.
    203  * If all type constructors involved in `f`'s type are marked `NoCC` or `AsIsCC`, we set `f`'s `idCC` field to `AsIsCC`.
    204  * Otherwise, convert `f` and set its `ifCC` field to `ConvCC f_CC`.
    205223
    206224=== Converting core terms ===