Changes between Version 18 and Version 19 of Commentary/Compiler/StrictnessAnalysis/KirstenNotes


Ignore:
Timestamp:
Nov 15, 2006 5:50:19 PM (7 years ago)
Author:
kirsten
Comment:

--

Legend:

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

    v18 v19  
    7373 
    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. 
     75 
     76= WARN: arity /= dmdTypeDepth rhs_dmd_ty && not (exprIsTrivial rhs) = 
     77 
     78This warning can happen 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]) 
     80- 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