Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Tobias Decking
GHC
Commits
a0a97c2b
Commit
a0a97c2b
authored
Jul 25, 2007
by
rl@cse.unsw.edu.au
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactoring
parent
2924c4bc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
11 deletions
+12
-11
compiler/vectorise/VectUtils.hs
compiler/vectorise/VectUtils.hs
+8
-1
compiler/vectorise/Vectorise.hs
compiler/vectorise/Vectorise.hs
+4
-10
No files found.
compiler/vectorise/VectUtils.hs
View file @
a0a97c2b
...
...
@@ -2,7 +2,7 @@ module VectUtils (
collectAnnTypeBinders
,
collectAnnTypeArgs
,
isAnnTypeArg
,
splitClosureTy
,
mkPADictType
,
mkPArrayType
,
paDictArgType
,
paDictOfType
,
paDictArgType
,
paDictOfType
,
paMethod
,
lookupPArrayFamInst
,
hoistExpr
,
takeHoisted
)
where
...
...
@@ -108,6 +108,13 @@ paDFunApply dfun tys
dicts
<-
mapM
paDictOfType
tys
return
$
mkApps
(
mkTyApps
dfun
tys
)
dicts
paMethod
::
(
Builtins
->
Var
)
->
Type
->
VM
CoreExpr
paMethod
method
ty
=
do
fn
<-
builtin
method
dict
<-
paDictOfType
ty
return
$
mkApps
(
Var
fn
)
[
Type
ty
,
dict
]
lookupPArrayFamInst
::
Type
->
VM
(
TyCon
,
[
Type
])
lookupPArrayFamInst
ty
=
builtin
parrayTyCon
>>=
(`
lookupFamInst
`
[
ty
])
...
...
compiler/vectorise/Vectorise.hs
View file @
a0a97c2b
...
...
@@ -142,13 +142,8 @@ vectBndrsIn vs p
-- Expressions
replicateP
::
CoreExpr
->
CoreExpr
->
VM
CoreExpr
replicateP
expr
len
=
do
dict
<-
paDictOfType
ty
rep
<-
builtin
replicatePAVar
return
$
mkApps
(
Var
rep
)
[
Type
ty
,
dict
,
expr
,
len
]
where
ty
=
exprType
expr
replicateP
expr
len
=
liftM
(`
mkApps
`
[
expr
,
len
])
(
paMethod
replicatePAVar
(
exprType
expr
))
capply
::
(
CoreExpr
,
CoreExpr
)
->
(
CoreExpr
,
CoreExpr
)
->
VM
(
CoreExpr
,
CoreExpr
)
capply
(
vfn
,
lfn
)
(
varg
,
larg
)
...
...
@@ -410,10 +405,9 @@ mkClosureMonoFns info arg body
bind_lenv
lenv
lbody
lc_bndr
[
lbndr
]
=
do
lengthPA
<-
builtin
lengthPAVar
pa_dict
<-
paDictOfType
vty
lengthPA
<-
paMethod
lengthPAVar
vty
return
.
Let
(
NonRec
lbndr
lenv
)
$
Case
(
mk
App
s
(
Var
lengthPA
)
[
Type
vty
,
pa_dict
,
(
Var
lbndr
)
]
)
$
Case
(
App
lengthPA
(
Var
lbndr
))
lc_bndr
(
exprType
lbody
)
[(
DEFAULT
,
[]
,
lbody
)]
...
...
Write
Preview
Markdown
is supported
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