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
396
Merge Requests
396
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
d3020a70
Commit
d3020a70
authored
Apr 04, 2012
by
dimitris
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding a forgotten pre-canonicalication cache-lookup stage.
parent
e3e740d9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
+22
-2
compiler/typecheck/TcInteract.lhs
compiler/typecheck/TcInteract.lhs
+21
-1
compiler/typecheck/TcSMonad.lhs
compiler/typecheck/TcSMonad.lhs
+1
-1
No files found.
compiler/typecheck/TcInteract.lhs
View file @
d3020a70
...
...
@@ -208,7 +208,8 @@ React with (F Int ~ b) ==> IR Stop True [] -- after substituting we re-canoni
\begin{code}
thePipeline :: [(String,SimplifierStage)]
thePipeline = [ ("canonicalization", canonicalizationStage)
thePipeline = [ ("lookup-in-inerts", lookupInInertsStage)
, ("canonicalization", canonicalizationStage)
, ("spontaneous solve", spontaneousSolveStage)
, ("interact with inerts", interactWithInertsStage)
, ("top-level reactions", topReactionsStage) ]
...
...
@@ -217,6 +218,25 @@ thePipeline = [ ("canonicalization", canonicalizationStage)
\begin{code}
-- A quick lookup everywhere to see if we know about this constraint
--------------------------------------------------------------------
lookupInInertsStage :: SimplifierStage
lookupInInertsStage ct
| isWantedCt ct
= do { is <- getTcSInerts
; ctxt <- getTcSContext
; case lookupInInerts is (ctPred ct) of
Just ct_cached
| (not $ isDerivedCt ct) && (not $ simplEqsOnly ctxt)
-- Don't share if we are simplifying a RULE
-- see Note [Simplifying RULE lhs constraints]
-> setEvBind (ctId ct) (EvId (ctId ct_cached)) >>
return Stop
_ -> continueWith ct }
| otherwise -- I could do something like that for givens
-- as well I suppose but it is not a big deal
= continueWith ct
-- The canonicalization stage, see TcCanonical for details
----------------------------------------------------------
...
...
compiler/typecheck/TcSMonad.lhs
View file @
d3020a70
...
...
@@ -65,7 +65,7 @@ module TcSMonad (
-- Inerts
InertSet(..), InertCans(..),
getInertEqs, getCtCoercion,
emptyInert, getTcSInerts, updInertSet, extractUnsolved,
emptyInert, getTcSInerts,
lookupInInerts,
updInertSet, extractUnsolved,
extractUnsolvedTcS, modifyInertTcS,
updInertSetTcS, partitionCCanMap, partitionEqMap,
getRelevantCts, extractRelevantInerts,
...
...
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