diff options
author | Joachim Breitner <mail@joachim-breitner.de> | 2018-04-11 11:24:01 -0400 |
---|---|---|
committer | Joachim Breitner <mail@joachim-breitner.de> | 2018-04-11 11:24:01 -0400 |
commit | 270e3e9bbaabad3d9a1348cea9e46a9ecf1e5ec2 (patch) | |
tree | 09213dd4f3edd92597067fa9849cb116eb7fcc28 /compiler/simplCore | |
parent | 74e768ea39c9b9b42ced7848f4d499f06d9fca29 (diff) | |
download | haskell-270e3e9bbaabad3d9a1348cea9e46a9ecf1e5ec2.tar.gz |
No need for sortQuantVars in Exitify after all
because `captured :: [Var]` is always in dependency order.
I added a comment in the crucial point so that this does not trip us up
again.
Diffstat (limited to 'compiler/simplCore')
-rw-r--r-- | compiler/simplCore/Exitify.hs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/compiler/simplCore/Exitify.hs b/compiler/simplCore/Exitify.hs index 6e7d063a6d..22edc20f7f 100644 --- a/compiler/simplCore/Exitify.hs +++ b/compiler/simplCore/Exitify.hs @@ -48,7 +48,6 @@ import VarEnv import CoreFVs import FastString import Type -import MkCore ( sortQuantVars ) import Data.Bifunctor import Control.Monad @@ -128,7 +127,7 @@ exitify in_scope pairs = -- variables bound on the way and lifts it out as a join point. -- -- ExitifyM is a state monad to keep track of floated binds - go :: [Var] -- ^ variables to abstract over + go :: [Var] -- ^ variables to abstract over (in dependency order) -> CoreExprWithFVs -- ^ current expression in tail position -> ExitifyM CoreExpr @@ -175,10 +174,8 @@ exitify in_scope pairs = is_interesting = anyVarSet isLocalId (fvs `minusVarSet` mkVarSet captured) -- The possible arguments of this exit join point - abs_vars = - map zap $ - sortQuantVars $ - filter (`elemVarSet` fvs) captured + -- No need for `sortQuantVars`, `captured` is already in dependency order + abs_vars = map zap $ filter (`elemVarSet` fvs) captured -- cf. SetLevels.abstractVars zap v | isId v = setIdInfo v vanillaIdInfo |