diff options
author | Ben Gamari <bgamari.foss@gmail.com> | 2016-07-20 09:56:03 +0200 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2016-07-20 15:57:52 +0200 |
commit | ed4809813fa51524ae73a4475afe33018a67f87d (patch) | |
tree | 7209ba49ff187096e86842a20367edaf0f1aae02 /compiler/iface/TcIface.hs | |
parent | 627c767b8e5587de52086d8891d7f7aabf6fa49f (diff) | |
download | haskell-ed4809813fa51524ae73a4475afe33018a67f87d.tar.gz |
InstEnv: Ensure that instance visibility check is lazy
Previously instIsVisible had completely broken the laziness of
lookupInstEnv' since it would examine is_dfun_name to check the name of
the defining module (to know whether it is an interactive module). This
resulted in the visibility check drawing in an interface file
unnecessarily. This contributed to the unnecessary regression in
compiler allocations reported in #12367.
Test Plan: Validate, check nofib changes
Reviewers: simonpj, ezyang, austin
Reviewed By: ezyang
Subscribers: thomie, ezyang
Differential Revision: https://phabricator.haskell.org/D2411
GHC Trac Issues: #12367
Diffstat (limited to 'compiler/iface/TcIface.hs')
-rw-r--r-- | compiler/iface/TcIface.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/iface/TcIface.hs b/compiler/iface/TcIface.hs index f366c516cd..6fda93d2d3 100644 --- a/compiler/iface/TcIface.hs +++ b/compiler/iface/TcIface.hs @@ -651,13 +651,13 @@ look at it. -} tcIfaceInst :: IfaceClsInst -> IfL ClsInst -tcIfaceInst (IfaceClsInst { ifDFun = dfun_occ, ifOFlag = oflag +tcIfaceInst (IfaceClsInst { ifDFun = dfun_name, ifOFlag = oflag , ifInstCls = cls, ifInstTys = mb_tcs , ifInstOrph = orph }) - = do { dfun <- forkM (text "Dict fun" <+> ppr dfun_occ) $ - tcIfaceExtId dfun_occ + = do { dfun <- forkM (text "Dict fun" <+> ppr dfun_name) $ + tcIfaceExtId dfun_name ; let mb_tcs' = map (fmap ifaceTyConName) mb_tcs - ; return (mkImportedInstance cls mb_tcs' dfun oflag orph) } + ; return (mkImportedInstance cls mb_tcs' dfun_name dfun oflag orph) } tcIfaceFamInst :: IfaceFamInst -> IfL FamInst tcIfaceFamInst (IfaceFamInst { ifFamInstFam = fam, ifFamInstTys = mb_tcs |