Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Reinier Maas
GHC
Commits
c5deaa27
Commit
c5deaa27
authored
3 years ago
by
Ben Gamari
Committed by
Marge Bot
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Reg.Liveness: Don't repeatedly construct UniqSets
parent
34d08a20
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
compiler/GHC/CmmToAsm/Reg/Liveness.hs
+8
-6
8 additions, 6 deletions
compiler/GHC/CmmToAsm/Reg/Liveness.hs
with
8 additions
and
6 deletions
compiler/GHC/CmmToAsm/Reg/Liveness.hs
+
8
−
6
View file @
c5deaa27
...
...
@@ -1024,15 +1024,15 @@ liveness1 platform liveregs blockmap (LiveInstr instr _)
=
(
liveregs1
,
LiveInstr
instr
(
Just
$
Liveness
{
liveBorn
=
emptyUniqSet
,
liveDieRead
=
mkUniqSet
r_dying
,
liveDieWrite
=
mkUniqSet
w_dying
}))
,
liveDieRead
=
r_dying
,
liveDieWrite
=
w_dying
}))
|
otherwise
=
(
liveregs_br
,
LiveInstr
instr
(
Just
$
Liveness
{
liveBorn
=
emptyUniqSet
,
liveDieRead
=
mkUniqSet
r_dying_br
,
liveDieWrite
=
mkUniqSet
w_dying
}))
,
liveDieWrite
=
w_dying
}))
where
!
(
RU
read
written
)
=
regUsageOfInstr
platform
instr
...
...
@@ -1044,10 +1044,12 @@ liveness1 platform liveregs blockmap (LiveInstr instr _)
-- registers that are not live beyond this point, are recorded
-- as dying here.
r_dying
=
[
reg
|
reg
<-
read
,
reg
`
notElem
`
written
,
r_dying
=
mkUniqSet
[
reg
|
reg
<-
read
,
reg
`
notElem
`
written
,
not
(
elementOfUniqSet
reg
liveregs
)
]
w_dying
=
[
reg
|
reg
<-
written
,
w_dying
=
mkUniqSet
[
reg
|
reg
<-
written
,
not
(
elementOfUniqSet
reg
liveregs
)
]
-- union in the live regs from all the jump destinations of this
...
...
@@ -1067,6 +1069,6 @@ liveness1 platform liveregs blockmap (LiveInstr instr _)
-- registers that are live only in the branch targets should
-- be listed as dying here.
live_branch_only
=
live_from_branch
`
minusUniqSet
`
liveregs
r_dying_br
=
nonDetEltsUniqSet
(
mkUniqSet
r_dying
`
unionUniqSets
`
r_dying_br
=
nonDetEltsUniqSet
(
r_dying
`
unionUniqSets
`
live_branch_only
)
-- See Note [Unique Determinism and code generation]
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment