[commit: ghc] master: In Exitify, zap idInfo of abstracted variables (fixes #15005) (3cfb12d)

git at git.haskell.org git at git.haskell.org
Tue Apr 10 18:20:14 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/3cfb12d8adac37e5565d66fd173e4648cc041e65/ghc

>---------------------------------------------------------------

commit 3cfb12d8adac37e5565d66fd173e4648cc041e65
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Tue Apr 10 09:36:08 2018 -0400

    In Exitify, zap idInfo of abstracted variables (fixes #15005)
    
    as helpfully outlined by SPJ.
    
    This commit copies a small bit code from `SetLevels` which could
    reasonably be put in `Id` as `zapAllIdinfo`; I did not do this to make
    merging this commmit into `ghc-8.4` easier.
    
    If this commit gets merged, then presumably after commit
    3f59d3802170f495702674b4f8e4e80247803654 (test case) and
    ae0cff0a1834d8b041b06d0e1ab6ce969aac44c8 (other fixes to Exitify.hs).
    
    Differential Revision: https://phabricator.haskell.org/D4582


>---------------------------------------------------------------

3cfb12d8adac37e5565d66fd173e4648cc041e65
 compiler/simplCore/Exitify.hs | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/compiler/simplCore/Exitify.hs b/compiler/simplCore/Exitify.hs
index 570186e..6e7d063 100644
--- a/compiler/simplCore/Exitify.hs
+++ b/compiler/simplCore/Exitify.hs
@@ -175,7 +175,14 @@ exitify in_scope pairs =
         is_interesting = anyVarSet isLocalId (fvs `minusVarSet` mkVarSet captured)
 
         -- The possible arguments of this exit join point
-        abs_vars = sortQuantVars $ filter (`elemVarSet` fvs) captured
+        abs_vars =
+            map zap $
+            sortQuantVars $
+            filter (`elemVarSet` fvs) captured
+
+        -- cf. SetLevels.abstractVars
+        zap v | isId v = setIdInfo v vanillaIdInfo
+              | otherwise = v
 
         -- We cannot abstract over join points
         captures_join_points = any isJoinId abs_vars



More information about the ghc-commits mailing list