[Git][ghc/ghc][wip/romes/12935] Wait, that was still there?!

Rodrigo Mesquita (@alt-romes) gitlab at gitlab.haskell.org
Mon Jun 24 11:39:48 UTC 2024



Rodrigo Mesquita pushed to branch wip/romes/12935 at Glasgow Haskell Compiler / GHC


Commits:
9bc583d3 by Rodrigo Mesquita at 2024-06-24T12:39:37+01:00
Wait, that was still there?!

- - - - -


2 changed files:

- compiler/GHC/Driver/CodeOutput.hs
- compiler/GHC/StgToCmm.hs


Changes:

=====================================
compiler/GHC/Driver/CodeOutput.hs
=====================================
@@ -39,7 +39,6 @@ import GHC.Data.OsPath
 import qualified GHC.Data.ShortText as ST
 import GHC.Data.Stream           ( Stream )
 import qualified GHC.Data.Stream as Stream
-import GHC.Cmm.UniqueRenamer
 
 import GHC.Utils.TmpFs
 
@@ -96,23 +95,12 @@ codeOutput logger tmpfs llvm_config dflags unit_state this_mod filenm location g
   cmm_stream
   =
     do  {
-        -- To produce deterministic object code, we alpha-rename all Uniques to deterministic uniques before Cmm linting.
-        -- From here on out, the backend code generation can't use (non-deterministic) Uniques, or risk producing non-deterministic code.
-        -- For example, the fix-up action in the ASM NCG should use determinist names for potential new blocks it has to create.
-        -- Therefore, in the ASM NCG `NatM` Monad we use a deterministic `UniqSuply` (which won't be shared about multiple threads)
-        -- TODO: Put these all into notes carefully organized
-        ; let renamed_cmm_stream = do
-                -- if gopt Opt_DeterministicObjects dflags
-
-                (rn_mapping, stream) <- Stream.mapAccumL_ (fmap pure . detRenameUniques) emptyDetUFM cmm_stream
-                Stream.liftIO $ debugTraceMsg logger 3 (text "DetRnM mapping:" <+> ppr rn_mapping)
-                return stream
 
         -- Lint each CmmGroup as it goes past
         ; let linted_cmm_stream =
                  if gopt Opt_DoCmmLinting dflags
-                    then Stream.mapM do_lint renamed_cmm_stream
-                    else renamed_cmm_stream
+                    then Stream.mapM do_lint cmm_stream
+                    else cmm_stream
 
               do_lint cmm = withTimingSilent logger
                   (text "CmmLint"<+>brackets (ppr this_mod))


=====================================
compiler/GHC/StgToCmm.hs
=====================================
@@ -152,6 +152,10 @@ codeGen logger tmpfs cfg (InfoTableProvMap (UniqMap denv) _ _) data_tycons
                 | otherwise
                 = mkNameEnv (Prelude.map extractInfo (nonDetEltsUFM cg_id_infos))
 
+          -- if gopt Opt_DeterministicObjects dflags
+        ; rn_mapping <- liftIO (readIORef uniqRnRef)
+        ; liftIO $ debugTraceMsg logger 3 (text "DetRnM mapping:" <+> ppr rn_mapping)
+
         ; return generatedInfo
         }
 



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9bc583d3268afd77fd3b03a102d94b45dc0549ee

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9bc583d3268afd77fd3b03a102d94b45dc0549ee
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/20240624/2b9a2d4f/attachment-0001.html>


More information about the ghc-commits mailing list