Make `seq#` a magic Id and inline it in CorePrep (#24124)
We can save much code and explanation in Tag Inference and StgToCmm by giving `seq#` a definition as a Magic Id in `GHC.Magic` and inline this definition in CorePrep. See the updated `Note [seq# magic]`. I also implemented a new `Note [Flatten case-bind]` to get better code for otherwise nested case scrutinees. I renamed the contructors of `ArgInfo` to use an `AI` prefix in order to resolve the clash between `type CpeApp = CoreExpr` and the data constructor of `ArgInfo`, as well as fixed typos in `Note [CorePrep invariants]`. Fixes #24252 and #24124.
Showing
- compiler/GHC/Builtin/Names.hs 3 additions, 1 deletioncompiler/GHC/Builtin/Names.hs
- compiler/GHC/Builtin/PrimOps.hs 1 addition, 2 deletionscompiler/GHC/Builtin/PrimOps.hs
- compiler/GHC/Builtin/primops.txt.pp 0 additions, 7 deletionscompiler/GHC/Builtin/primops.txt.pp
- compiler/GHC/Core/Opt/ConstantFold.hs 84 additions, 14 deletionscompiler/GHC/Core/Opt/ConstantFold.hs
- compiler/GHC/Core/Opt/DmdAnal.hs 14 additions, 5 deletionscompiler/GHC/Core/Opt/DmdAnal.hs
- compiler/GHC/Core/Opt/Simplify/Iteration.hs 2 additions, 3 deletionscompiler/GHC/Core/Opt/Simplify/Iteration.hs
- compiler/GHC/CoreToStg/Prep.hs 146 additions, 46 deletionscompiler/GHC/CoreToStg/Prep.hs
- compiler/GHC/Stg/InferTags.hs 3 additions, 15 deletionscompiler/GHC/Stg/InferTags.hs
- compiler/GHC/Stg/InferTags/Rewrite.hs 1 addition, 1 deletioncompiler/GHC/Stg/InferTags/Rewrite.hs
- compiler/GHC/StgToCmm/Expr.hs 0 additions, 26 deletionscompiler/GHC/StgToCmm/Expr.hs
- compiler/GHC/StgToCmm/Prim.hs 0 additions, 1 deletioncompiler/GHC/StgToCmm/Prim.hs
- compiler/GHC/StgToJS/Prim.hs 0 additions, 1 deletioncompiler/GHC/StgToJS/Prim.hs
- compiler/GHC/StgToJS/Utils.hs 1 addition, 3 deletionscompiler/GHC/StgToJS/Utils.hs
- compiler/GHC/Types/Id/Make.hs 28 additions, 2 deletionscompiler/GHC/Types/Id/Make.hs
- libraries/base/src/GHC/Exts.hs 1 addition, 1 deletionlibraries/base/src/GHC/Exts.hs
- libraries/ghc-prim/GHC/Magic.hs 11 additions, 1 deletionlibraries/ghc-prim/GHC/Magic.hs
- testsuite/tests/core-to-stg/T24124.hs 36 additions, 0 deletionstestsuite/tests/core-to-stg/T24124.hs
- testsuite/tests/core-to-stg/T24124.stderr 2 additions, 0 deletionstestsuite/tests/core-to-stg/T24124.stderr
- testsuite/tests/core-to-stg/all.T 1 addition, 0 deletionstestsuite/tests/core-to-stg/all.T
- testsuite/tests/simplStg/should_compile/T15226b.stderr 10 additions, 12 deletionstestsuite/tests/simplStg/should_compile/T15226b.stderr
Loading
Please register or sign in to comment