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
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
davjam
GHC
Commits
7e6bb343
Commit
7e6bb343
authored
11 years ago
by
Joachim Breitner
Browse files
Options
Downloads
Patches
Plain Diff
Speculative evaluate thunks known to Converge
This is an attempt to use the by-products of nested cpr analysis.
parent
fca15ac5
Loading
Loading
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
compiler/basicTypes/Demand.lhs
+9
-2
9 additions, 2 deletions
compiler/basicTypes/Demand.lhs
compiler/basicTypes/Id.lhs
+6
-1
6 additions, 1 deletion
compiler/basicTypes/Id.lhs
compiler/simplCore/Simplify.lhs
+1
-1
1 addition, 1 deletion
compiler/simplCore/Simplify.lhs
with
16 additions
and
4 deletions
compiler/basicTypes/Demand.lhs
+
9
−
2
View file @
7e6bb343
...
...
@@ -27,9 +27,9 @@ module Demand (
peelFV,
DmdResult, CPRResult,
isBotRes, isTopRes, resTypeArgDmd,
isBotRes, isTopRes, resTypeArgDmd,
topRes, convRes, botRes, cprProdRes, vanillaCprProdRes, cprSumRes,
appIsBottom, isBottomingSig, isConvSig, pprIfaceStrictSig,
appIsBottom, isBottomingSig, isConvSig, pprIfaceStrictSig,
trimCPRInfo, returnsCPR, returnsCPR_maybe,
StrictSig(..), mkStrictSig, mkClosedStrictSig, nopSig, botSig, cprProdSig, convergeSig,
isNopSig, splitStrictSig, increaseStrictSigArity,
...
...
@@ -812,6 +812,10 @@ isBotRes :: DmdResult -> Bool
isBotRes Diverges = True
isBotRes _ = False
isConvRes :: DmdResult -> Bool
isConvRes (Converges {}) = True
isConvRes _ = False
trimCPRInfo :: Bool -> Bool -> DmdResult -> DmdResult
trimCPRInfo trim_all trim_sums res
= trimR res
...
...
@@ -1439,6 +1443,9 @@ isNopSig (StrictSig ty) = isNopDmdType ty
isBottomingSig :: StrictSig -> Bool
isBottomingSig (StrictSig (DmdType _ _ res)) = isBotRes res
isConvSig :: StrictSig -> Bool
isConvSig (StrictSig (DmdType _ _ res)) = isConvRes res
nopSig, botSig :: StrictSig
nopSig = StrictSig nopDmdType
botSig = StrictSig botDmdType
...
...
This diff is collapsed.
Click to expand it.
compiler/basicTypes/Id.lhs
+
6
−
1
View file @
7e6bb343
...
...
@@ -47,7 +47,7 @@ module Id (
-- ** Predicates on Ids
isImplicitId, isDeadBinder,
isStrictId,
isStrictId,
isConvId,
isExportedId, isLocalId, isGlobalId,
isRecordSelector, isNaughtyRecordSelector,
isClassOpId_maybe, isDFunId,
...
...
@@ -495,6 +495,11 @@ isStrictId id
-- Take the best of both strictnesses - old and new
(isStrictDmd (idDemandInfo id))
isConvId :: Id -> Bool
isConvId id
= ASSERT2( isId id, text "isConvId: not an id: " <+> ppr id )
(isConvSig (idStrictness id))
---------------------------------
-- UNFOLDING
idUnfolding :: Id -> Unfolding
...
...
This diff is collapsed.
Click to expand it.
compiler/simplCore/Simplify.lhs
+
1
−
1
View file @
7e6bb343
...
...
@@ -1347,7 +1347,7 @@ simplNonRecE env bndr (rhs, rhs_se) (bndrs, body) cont
; -- pprTrace "preInlineUncond" (ppr bndr <+> ppr rhs) $
simplLam (extendIdSubst env bndr (mkContEx rhs_se rhs)) bndrs body cont }
| isStrictId bndr
->
-- Includes coercions
| isStrictId bndr
|| isConvId bndr ->
-- Includes coercions
do { simplExprF (rhs_se `setFloats` env) rhs
(StrictBind bndr bndrs body env cont) }
...
...
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