[commit: ghc] new-demand: rearrangements (9bef451)
Ilya Sergey
ilya at galois.com
Mon Jul 16 22:20:13 CEST 2012
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : new-demand
http://hackage.haskell.org/trac/ghc/changeset/9bef451676def6338b250f62b5eb0b4674aab990
>---------------------------------------------------------------
commit 9bef451676def6338b250f62b5eb0b4674aab990
Author: Ilya Sergey <Ilya.Sergey at cs.kuleuven.be>
Date: Mon Jul 16 19:30:32 2012 +0100
rearrangements
>---------------------------------------------------------------
compiler/basicTypes/NewDemand.lhs | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/compiler/basicTypes/NewDemand.lhs b/compiler/basicTypes/NewDemand.lhs
index e9d2741..53fbdbd 100644
--- a/compiler/basicTypes/NewDemand.lhs
+++ b/compiler/basicTypes/NewDemand.lhs
@@ -644,15 +644,13 @@ instance LatticeLike DmdType where
lub (DmdType fv1 ds1 r1) (DmdType fv2 ds2 r2)
= DmdType lub_fv2 (lub_ds ds1 ds2) (r1 `lub` r2)
- -- Consider (if x then y else []) with demand V
- -- Then the first branch gives {y->V} and the second
- -- *implicitly* has {y->A}. So we must put {y->(V `lub` A)}
- -- in the result env.
where
absLub = lub absDmd
lub_fv = plusVarEnv_C lub fv1 fv2
- -- TODO: write down an example
- -- TODO: compute a lub-candidate from r1 and r2
+ -- Consider (if x then y else []) with demand V
+ -- Then the first branch gives {y->V} and the second
+ -- *implicitly* has {y->A}. So we must put {y->(V `lub` A)}
+ -- in the result env.
lub_fv1 = modifyEnv (not (isBotRes r1)) absLub fv2 fv1 lub_fv
lub_fv2 = modifyEnv (not (isBotRes r2)) absLub fv1 fv2 lub_fv1
-- lub is the identity for Bot
More information about the Cvs-ghc
mailing list