Commit 2f5b97c3 authored by Joachim Breitner's avatar Joachim Breitner Committed by Ben Gamari

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
3f59d380 (test case) and
ae0cff0a (other fixes to Exitify.hs).

Differential Revision:

(cherry picked from commit 3cfb12d8)
parent e1071f6e
......@@ -48,6 +48,7 @@ import VarEnv
import CoreFVs
import FastString
import Type
import MkCore ( sortQuantVars )
import Data.Bifunctor
import Control.Monad
......@@ -166,7 +167,14 @@ exitify in_scope pairs =
is_interesting = anyVarSet isLocalId (fvs `minusVarSet` mkVarSet captured)
-- The possible arguments of this exit join point
args = filter (`elemVarSet` fvs) captured
args =
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 args
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment