summaryrefslogtreecommitdiff
path: root/compiler/GHC/Core/Utils.hs
diff options
context:
space:
mode:
authorGergő Érdi <gergo@erdi.hu>2022-12-02 03:00:54 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2022-12-13 08:57:41 +0000
commitdfe222ccfb999b2ffce782972137b28c3e2152a0 (patch)
tree48c703c543ff7cbc03f2737e61dc5fb691ffea6d /compiler/GHC/Core/Utils.hs
parentc30accc2f8a0585c76cb534beda04fba624bce1c (diff)
downloadhaskell-wip/T22272.tar.gz
Fix loop in the interface representation of some `Unfolding` fieldswip/T22272
As discovered in #22272, dehydration of the unfolding info of a recursive definition used to involve a traversal of the definition itself, which in turn involves traversing the unfolding info. Hence, a loop. Instead, we now store enough data in the interface that we can produce the unfolding info without this traversal. See Note [Tying the 'CoreUnfolding' knot] for details. Fixes #22272 Co-authored-by: Simon Peyton Jones <simon.peytonjones@gmail.com>
Diffstat (limited to 'compiler/GHC/Core/Utils.hs')
-rw-r--r--compiler/GHC/Core/Utils.hs7
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/GHC/Core/Utils.hs b/compiler/GHC/Core/Utils.hs
index 3f3ef30a14..c88ddb3d55 100644
--- a/compiler/GHC/Core/Utils.hs
+++ b/compiler/GHC/Core/Utils.hs
@@ -2253,10 +2253,9 @@ diffUnfold env (DFunUnfolding bs1 c1 a1)
| c1 == c2 && equalLength bs1 bs2
= concatMap (uncurry (diffExpr False env')) (zip a1 a2)
where env' = rnBndrs2 env bs1 bs2
-diffUnfold env (CoreUnfolding t1 _ _ v1 cl1 wf1 x1 g1)
- (CoreUnfolding t2 _ _ v2 cl2 wf2 x2 g2)
- | v1 == v2 && cl1 == cl2
- && wf1 == wf2 && x1 == x2 && g1 == g2
+diffUnfold env (CoreUnfolding t1 _ _ c1 g1)
+ (CoreUnfolding t2 _ _ c2 g2)
+ | c1 == c2 && g1 == g2
= diffExpr False env t1 t2
diffUnfold _ uf1 uf2
= [fsep [ppr uf1, text "/=", ppr uf2]]