[Git][ghc/ghc][wip/con-info] 2 commits: Info table rather than closure

Matthew Pickering gitlab at gitlab.haskell.org
Fri Nov 6 17:40:09 UTC 2020



Matthew Pickering pushed to branch wip/con-info at Glasgow Haskell Compiler / GHC


Commits:
d95bb9ec by Matthew Pickering at 2020-11-06T17:02:17+00:00
Info table rather than closure

- - - - -
2eed068b by Matthew Pickering at 2020-11-06T17:39:53+00:00
Try to fix performance problem

- - - - -


4 changed files:

- compiler/GHC/StgToCmm/Monad.hs
- includes/rts/IPE.h
- rts/IPE.c
- rts/PrimOps.cmm


Changes:

=====================================
compiler/GHC/StgToCmm/Monad.hs
=====================================
@@ -817,8 +817,13 @@ emitProc mb_info lbl live blocks offset do_layout
               proc_block = CmmProc tinfo lbl live blks
 
         ; state <- getState
+        ; dflags <- getDynFlags
+        ; let new_info
+                | gopt Opt_InfoTableMap dflags
+                    = maybe (cgs_used_info state) (: cgs_used_info state) mb_info
+                | otherwise = []
         ; setState $ state { cgs_tops = cgs_tops state `snocOL` proc_block
-                           , cgs_used_info = maybe (cgs_used_info state) (: cgs_used_info state) mb_info } }
+                           , cgs_used_info = new_info } }
 
 getCmm :: FCode () -> FCode CmmGroup
 -- Get all the CmmTops (there should be no stmts)


=====================================
includes/rts/IPE.h
=====================================
@@ -14,4 +14,4 @@
 #pragma once
 
 void registerInfoProvList(InfoProvEnt **cc_list);
-InfoProvEnt * lookupIPE(StgClosure *info);
\ No newline at end of file
+InfoProvEnt * lookupIPE(StgInfoTable *info);
\ No newline at end of file


=====================================
rts/IPE.c
=====================================
@@ -69,18 +69,17 @@ void registerInfoProvList(InfoProvEnt **ent_list)
 
 // MP: TODO: This should not be a linear search, need to improve
 // the IPE_LIST structure
-InfoProvEnt * lookupIPE(StgClosure *clos)
+InfoProvEnt * lookupIPE(StgInfoTable *info)
 {
-    StgInfoTable * info;
-    info = GET_INFO(clos);
     InfoProvEnt *ip, *next;
-    //printf("%p\n", info);
+//    printf("%p\n", info);
     //printf("%p\n\n", clos);
     for (ip = IPE_LIST; ip != NULL; ip = next) {
+//        printf("%p\n", ip->info);
         if (ip->info == info) {
             //printf("Found %p\n", ip->info);
             return ip;
         }
         next = ip->link;
     }
-}
\ No newline at end of file
+}


=====================================
rts/PrimOps.cmm
=====================================
@@ -2412,7 +2412,9 @@ stg_closureSizzezh (P_ clos)
 stg_whereFromzh (P_ clos)
 {
     P_ ipe;
-    (ipe) = foreign "C" lookupIPE(UNTAG(clos) "ptr");
+    W_ info;
+    info = GET_INFO(UNTAG(clos));
+    (ipe) = foreign "C" lookupIPE(info "ptr");
     return (ipe);
 }
 



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b21a42b28d7e9c4927cdcdda08a28551acee512f...2eed068bef601f3ea544dc906b7f6b5fd3211f06

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b21a42b28d7e9c4927cdcdda08a28551acee512f...2eed068bef601f3ea544dc906b7f6b5fd3211f06
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20201106/8f428df5/attachment-0001.html>


More information about the ghc-commits mailing list