Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Shayne Fletcher
Glasgow Haskell Compiler
Commits
b6fc60f5
Commit
b6fc60f5
authored
Jul 16, 2007
by
rl@cse.unsw.edu.au
Browse files
Store hoisted bindings in the global environment during vectorisation
parent
9685c129
Changes
2
Hide whitespace changes
Inline
Side-by-side
compiler/vectorise/VectMonad.hs
View file @
b6fc60f5
...
...
@@ -121,6 +121,9 @@ data GlobalEnv = GlobalEnv {
-- instances
--
,
global_fam_inst_env
::
FamInstEnvs
-- Hoisted bindings
,
global_bindings
::
[(
Var
,
CoreExpr
)]
}
data
LocalEnv
=
LocalEnv
{
...
...
@@ -131,9 +134,6 @@ data LocalEnv = LocalEnv {
-- Mapping from tyvars to their PA dictionaries
,
local_tyvar_pa
::
VarEnv
CoreExpr
-- Hoisted bindings
,
local_bindings
::
[(
Var
,
CoreExpr
)]
}
...
...
@@ -146,12 +146,12 @@ initGlobalEnv info instEnvs famInstEnvs
,
global_tycon_pa
=
emptyNameEnv
,
global_inst_env
=
instEnvs
,
global_fam_inst_env
=
famInstEnvs
,
global_bindings
=
[]
}
emptyLocalEnv
=
LocalEnv
{
local_vars
=
emptyVarEnv
,
local_tyvar_pa
=
emptyVarEnv
,
local_bindings
=
[]
}
-- FIXME
...
...
compiler/vectorise/VectUtils.hs
View file @
b6fc60f5
...
...
@@ -115,7 +115,7 @@ hoistExpr :: FastString -> CoreExpr -> VM Var
hoistExpr
fs
expr
=
do
var
<-
newLocalVar
fs
(
exprType
expr
)
upd
L
Env
$
\
env
->
env
{
lo
c
al_bindings
=
(
var
,
expr
)
:
lo
c
al_bindings
env
}
upd
G
Env
$
\
env
->
env
{
g
lo
b
al_bindings
=
(
var
,
expr
)
:
g
lo
b
al_bindings
env
}
return
var
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment