Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Haley Sapphie Owsianko
ACC-project
Commits
e86031e1
Commit
e86031e1
authored
May 01, 2021
by
Sapphie
Browse files
Fix/Implement CSE
parent
ded6fc57
Changes
1
Show whitespace changes
Inline
Side-by-side
compiler/src/l3/CPSOptimizer.scala
View file @
e86031e1
...
...
@@ -115,8 +115,7 @@ abstract class CPSOptimizer[T <: CPSTreeModule { type Name = Symbol }]
val
allLitOpt
=
replacedArgs
.
map
(
_
.
asLiteral
)
val
isAllLit
=
allLitOpt
.
forall
(
_
.
isDefined
)
lazy
val
asLit
=
allLitOpt
.
map
(
_
.
get
)
// TODO: fix this. For some reason it doesn't work
if
(
false
&&
s
.
eInvEnv
.
isDefinedAt
((
prim
,
replacedArgs
)))
{
if
(!
unstable
(
prim
)
&&
!
impure
(
prim
)
&&
s
.
eInvEnv
.
isDefinedAt
((
prim
,
replacedArgs
)))
{
val
preComputedAtom
=
s
.
eInvEnv
((
prim
,
replacedArgs
))
shrink
(
body
,
newState
.
withASubst
(
name
,
preComputedAtom
))
}
else
{
...
...
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