Commits on Source (2)
-
da0d8ba5
-
Don't use bigNatFromWord#, because that's terrible: * We shouldn't have to traverse a linked list at run-time to build a BigNat# literal. That's just silly! * The static List object we have to create is much larger than the actual BigNat#'s contents, bloating code size. * We have to read the corresponding interface file, which causes un-tracked implicit dependencies. (#23942) Instead, encode them into the appropriate platform-dependent sequence of bytes, and generate code that copies these bytes at run-time from an Addr# literal into a new ByteArray#. A ByteArray# literal would be the correct thing to generate, but these are not yet supported; see also #17747. Somewhat surprisingly, this change results in a slight reduction in compiler allocations, averaging around 0.5% on ghc's compiler performance tests, including when compiling programs that contain no bignum literals to begin with. The specific cause of this has not been investigated. Since this lowering no longer reads the interface file for GHC.Num.BigNat, the reasoning in Note [Depend on GHC.Num.Integer] is obsoleted. But the story of un-tracked built-in dependencies remains complex, and Note [Tracking dependencies on primitives] now exists to explain this complexity. Additionally, many empty imports have been modified to refer to this new note and comply with its guidance. Several empty imports necessary for other reasons have also been given brief explanations. Metric Decrease: MultiLayerModulesTH_OneShot
b56d2761
Showing
- compiler/GHC/Builtin/Names.hs 0 additions, 5 deletionscompiler/GHC/Builtin/Names.hs
- compiler/GHC/Builtin/PrimOps.hs-boot 2 additions, 1 deletioncompiler/GHC/Builtin/PrimOps.hs-boot
- compiler/GHC/Builtin/Types/Prim.hs 5 additions, 2 deletionscompiler/GHC/Builtin/Types/Prim.hs
- compiler/GHC/Cmm/Dominators.hs 0 additions, 1 deletioncompiler/GHC/Cmm/Dominators.hs
- compiler/GHC/Core/TyCo/Subst.hs 1 addition, 1 deletioncompiler/GHC/Core/TyCo/Subst.hs
- compiler/GHC/CoreToStg/Prep.hs 129 additions, 67 deletionscompiler/GHC/CoreToStg/Prep.hs
- compiler/GHC/Data/Word64Map/Strict.hs 0 additions, 1 deletioncompiler/GHC/Data/Word64Map/Strict.hs
- compiler/GHC/Driver/CmdLine.hs 1 addition, 1 deletioncompiler/GHC/Driver/CmdLine.hs
- compiler/GHC/Driver/Config/CoreToStg/Prep.hs 1 addition, 7 deletionscompiler/GHC/Driver/Config/CoreToStg/Prep.hs
- compiler/GHC/Driver/Config/Diagnostic.hs 1 addition, 1 deletioncompiler/GHC/Driver/Config/Diagnostic.hs
- compiler/GHC/Driver/Errors/Ppr.hs 4 additions, 4 deletionscompiler/GHC/Driver/Errors/Ppr.hs
- compiler/GHC/Iface/Errors/Ppr.hs 1 addition, 1 deletioncompiler/GHC/Iface/Errors/Ppr.hs
- compiler/GHC/Iface/Syntax.hs 1 addition, 1 deletioncompiler/GHC/Iface/Syntax.hs
- compiler/GHC/Iface/Type.hs-boot 1 addition, 1 deletioncompiler/GHC/Iface/Type.hs-boot
- compiler/GHC/Parser/PostProcess.hs 0 additions, 1 deletioncompiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Platform.hs 1 addition, 1 deletioncompiler/GHC/Platform.hs
- compiler/GHC/StgToJS/Types.hs 1 addition, 1 deletioncompiler/GHC/StgToJS/Types.hs
- compiler/GHC/Tc/Errors/Hole/Plugin.hs-boot 4 additions, 1 deletioncompiler/GHC/Tc/Errors/Hole/Plugin.hs-boot
- compiler/GHC/Tc/Types/LclEnv.hs-boot 4 additions, 1 deletioncompiler/GHC/Tc/Types/LclEnv.hs-boot
- compiler/GHC/Tc/Utils/Env.hs 1 addition, 1 deletioncompiler/GHC/Tc/Utils/Env.hs