Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
4,251
Issues
4,251
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
394
Merge Requests
394
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
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
Glasgow Haskell Compiler
GHC
Commits
62d1888f
Commit
62d1888f
authored
Feb 11, 2016
by
Simon Peyton Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Comments about ru_auto
...following a question from Conal
parent
85008555
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
13 deletions
+16
-13
compiler/coreSyn/CoreSyn.hs
compiler/coreSyn/CoreSyn.hs
+7
-6
compiler/main/TidyPgm.hs
compiler/main/TidyPgm.hs
+9
-7
No files found.
compiler/coreSyn/CoreSyn.hs
View file @
62d1888f
...
...
@@ -864,15 +864,16 @@ data CoreRule
-- See Note [OccInfo in unfoldings and rules]
-- Locality
ru_auto
::
Bool
,
-- ^ @True@ <=> this rule is auto-generated
-- @False@ <=> generated at the users behest
-- Main effect: reporting of orphan-hood
ru_auto
::
Bool
,
-- ^ @True@ <=> this rule is auto-generated
-- (notably by Specialise or SpecConstr)
-- @False@ <=> generated at the users behest
-- See Note [Trimming auto-rules] in TidyPgm
-- for the sole purpose of this field.
ru_origin
::
!
Module
,
-- ^ 'Module' the rule was defined in, used
ru_origin
::
!
Module
,
-- ^ 'Module' the rule was defined in, used
-- to test if we should see an orphan rule.
ru_orphan
::
!
IsOrphan
,
-- ^ Whether or not the rule is an orphan.
ru_orphan
::
!
IsOrphan
,
-- ^ Whether or not the rule is an orphan.
ru_local
::
Bool
-- ^ @True@ iff the fn at the head of the rule is
-- defined in the same module as the rule
...
...
compiler/main/TidyPgm.hs
View file @
62d1888f
...
...
@@ -887,9 +887,13 @@ reference to f_spec except from the RULE.
Now that RULE *might* be useful to an importing module, but that is
purely speculative, and meanwhile the code is taking up space and
codegen time. So is seeems better to drop the binding for f_spec if
the auto-generated rule is the *only* reason that it is being kept
alive.
codegen time. I found that binary sizes jumped by 6-10% when I
started to specialise INLINE functions (again, Note [Inline
specialisations] in Specialise).
So it seeems better to drop the binding for f_spec, and the rule
itself, if the auto-generated rule is the *only* reason that it is
being kept alive.
(The RULE still might have been useful in the past; that is, it was
the right thing to have generated it in the first place. See Note
...
...
@@ -902,12 +906,10 @@ So findExternalRules does this:
* Remove all auto rules that mention bindings that have been removed
(this is done by filtering by keep_rule)
So
if a binding is kept alive for some *other* reason (e.g. f_spec is
NB:
if a binding is kept alive for some *other* reason (e.g. f_spec is
called in the final code), we keep the rule too.
I found that binary sizes jumped by 6-10% when I started to specialise
INLINE functions (again, Note [Inline specialisations] in Specialise).
Adding trimAutoRules removed all this bloat.
This stuff is the only reason for the ru_auto field in a Rule.
-}
findExternalRules
::
Bool
-- Omit pragmas
...
...
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