Introduce `dataToTagSmall#` primop (closes #21710)
...and use it to generate slightly better code when dataToTag# is used at a "small data type" where there is no need to mess with "is_too_big_tag" or potentially look at an info table. Metric Decrease: T18304
Showing
- compiler/GHC/Builtin/PrimOps.hs 2 additions, 1 deletioncompiler/GHC/Builtin/PrimOps.hs
- compiler/GHC/Builtin/primops.txt.pp 21 additions, 1 deletioncompiler/GHC/Builtin/primops.txt.pp
- compiler/GHC/Core/Lint.hs 11 additions, 5 deletionscompiler/GHC/Core/Lint.hs
- compiler/GHC/Core/Opt/ConstantFold.hs 17 additions, 8 deletionscompiler/GHC/Core/Opt/ConstantFold.hs
- compiler/GHC/Stg/InferTags/Rewrite.hs 4 additions, 5 deletionscompiler/GHC/Stg/InferTags/Rewrite.hs
- compiler/GHC/StgToCmm/Expr.hs 45 additions, 48 deletionscompiler/GHC/StgToCmm/Expr.hs
- compiler/GHC/StgToCmm/Prim.hs 2 additions, 1 deletioncompiler/GHC/StgToCmm/Prim.hs
- compiler/GHC/StgToJS/Prim.hs 5 additions, 1 deletioncompiler/GHC/StgToJS/Prim.hs
- compiler/GHC/Tc/Instance/Class.hs 123 additions, 36 deletionscompiler/GHC/Tc/Instance/Class.hs
- libraries/base/src/GHC/Base.hs 2 additions, 2 deletionslibraries/base/src/GHC/Base.hs
- libraries/base/src/GHC/Exts.hs 2 additions, 2 deletionslibraries/base/src/GHC/Exts.hs
- testsuite/tests/codeGen/should_compile/T21710a.stderr 31 additions, 288 deletionstestsuite/tests/codeGen/should_compile/T21710a.stderr
- testsuite/tests/simplCore/should_compile/T22375.hs 13 additions, 6 deletionstestsuite/tests/simplCore/should_compile/T22375.hs
- testsuite/tests/simplCore/should_compile/T22375.stderr 13 additions, 8 deletionstestsuite/tests/simplCore/should_compile/T22375.stderr
- testsuite/tests/simplCore/should_compile/T22375DataFamily.hs 13 additions, 6 deletionstestsuite/tests/simplCore/should_compile/T22375DataFamily.hs
- testsuite/tests/simplCore/should_compile/T22375DataFamily.stderr 68 additions, 8 deletions...te/tests/simplCore/should_compile/T22375DataFamily.stderr
Loading
Please register or sign in to comment