Changes between Version 21 and Version 22 of Commentary/Compiler/StrictnessAnalysis/KirstenNotes


Ignore:
Timestamp:
Nov 17, 2006 6:37:34 PM (7 years ago)
Author:
kirsten
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/Compiler/StrictnessAnalysis/KirstenNotes

    v21 v22  
    7474When we run into an expression like {{{(Cast e co)}}} that we're placing demand {{{d}}} on, we analyze {{{e}}} to get {{{dmd_ty}}}, then check whether the depth of {{{e}}} is equal to the depth of {{{dmd_ty}}} or not. This is necessary because we might be casting a function to a non-function type. So, if {{{d}}} and {{{dmd_ty}}} have equal depth, we return {{{dmd_ty}}} as is; if {{{d}}}'s arity is less, we drop the appropriate number of args from {{{dmd_ty}}}; if {{{dmd_ty}}}'s arity is less, we add the appropriate number of dummy argument demands to it. 
    7575 
    76 = <nowiki>WARN: arity /= dmdTypeDepth rhs_dmd_ty && not (exprIsTrivial rhs)</nowiki> = 
     76= WARN: arity /= dmdTypeDepth rhs_dmd_ty && not (exprIsTrivial rhs) = 
    7777 
    7878This warning was happening for (at least) two reasons: 
    79 - lambdas with a strict non-call demand placed on them were being handled wrong (see the first two examples in [[Commentary/Compiler/StrictnessAnalysis/Examples]]) 
     79- lambdas with a strict non-call demand placed on them were being handled wrong (see the first two examples in [[wiki:Commentary/Compiler/StrictnessAnalysis/Examples]]) 
    8080- coercions were being handled wrong, resulting in a demand type with depth 0 being assigned to an rhs consisting of a cast from/to a function type 
    8181