Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Glasgow Haskell Compiler
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shayne Fletcher
Glasgow Haskell Compiler
Commits
88a6f863
Commit
88a6f863
authored
Oct 23, 2012
by
Simon Marlow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small optimisation: always sink/inline reg1 = reg2 assignments
parent
a7e0d448
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
compiler/cmm/CmmSink.hs
compiler/cmm/CmmSink.hs
+5
-6
No files found.
compiler/cmm/CmmSink.hs
View file @
88a6f863
...
...
@@ -178,7 +178,7 @@ cmmSink dflags graph = ofBlockList (g_entry graph) $ sink mapEmpty $ blocks
drop_if
a
@
(
r
,
rhs
,
_
)
live_sets
=
(
should_drop
,
live_sets'
)
where
should_drop
=
conflicts
dflags
a
final_last
||
{- not (isSmall rhs) && -}
live_in_multi
live_sets
r
||
not
(
isTrivial
rhs
)
&&
live_in_multi
live_sets
r
||
r
`
Set
.
member
`
live_in_joins
live_sets'
|
should_drop
=
live_sets
...
...
@@ -205,12 +205,12 @@ isSmall (CmmLit _) = True
isSmall (CmmMachOp (MO_Add _) [x,y]) = isTrivial x && isTrivial y
isSmall (CmmRegOff (CmmLocal _) _) = True
isSmall _ = False
-}
isTrivial
::
CmmExpr
->
Bool
isTrivial
(
CmmReg
(
CmmLocal
_
))
=
True
isTrivial (CmmLit _) = True
--
isTrivial (CmmLit _) = True
isTrivial
_
=
False
-}
--
-- annotate each node with the set of registers live *after* the node
...
...
@@ -365,9 +365,8 @@ tryToInline dflags live node assigs = go usages node [] assigs
go
_usages
node
_skipped
[]
=
(
node
,
[]
)
go
usages
node
skipped
(
a
@
(
l
,
rhs
,
_
)
:
rest
)
|
can_inline
=
inline_and_discard
|
False
{- isTiny rhs -}
=
inline_and_keep
-- ^^ seems to make things slightly worse
|
can_inline
=
inline_and_discard
|
isTrivial
rhs
=
inline_and_keep
where
inline_and_discard
=
go
usages'
node'
skipped
rest
...
...
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