diff options
author | Sebastian Graf <sebastian.graf@kit.edu> | 2021-03-01 21:40:22 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-03-26 23:02:15 -0400 |
commit | 57d21e6a522f5522ba238675e74f510ab8e5d300 (patch) | |
tree | 4132fca9afc4c2ee8ca0d23266919c77fec27201 /compiler/GHC/StgToCmm/Env.hs | |
parent | 5741caeb0454c1bee9ca865ce6c3dfdd980ecf3e (diff) | |
download | haskell-57d21e6a522f5522ba238675e74f510ab8e5d300.tar.gz |
Rubbish literals for all representations (#18983)
This patch cleans up the complexity around WW's `mk_absent_let` by
broadening the scope of `LitRubbish`. Rubbish literals now store the
`PrimRep` they represent and are ultimately lowered in Cmm.
This in turn allows absent literals of `VecRep` or `VoidRep`. The latter
allows absent literals for unlifted coercions, as requested in #18983.
I took the liberty to rewrite and clean up `Note [Absent fillers]` and
`Note [Rubbish values]` to account for the new implementation and to
make them more orthogonal in their description.
I didn't add a new regression test, as `T18982` already contains the
test in the ticket and its test output changes as expected.
Fixes #18983.
Diffstat (limited to 'compiler/GHC/StgToCmm/Env.hs')
-rw-r--r-- | compiler/GHC/StgToCmm/Env.hs | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/compiler/GHC/StgToCmm/Env.hs b/compiler/GHC/StgToCmm/Env.hs index ebfff0185f..5f4ef641c4 100644 --- a/compiler/GHC/StgToCmm/Env.hs +++ b/compiler/GHC/StgToCmm/Env.hs @@ -17,7 +17,6 @@ module GHC.StgToCmm.Env ( bindArgsToRegs, bindToReg, rebindToReg, bindArgToReg, idToReg, - getArgAmode, getNonVoidArgAmodes, getCgIdInfo, maybeLetNoEscape, ) where @@ -26,10 +25,8 @@ module GHC.StgToCmm.Env ( import GHC.Prelude -import GHC.Core.TyCon import GHC.Platform import GHC.StgToCmm.Monad -import GHC.StgToCmm.Utils import GHC.StgToCmm.Closure import GHC.Cmm.CLabel @@ -40,7 +37,6 @@ import GHC.Cmm.Utils import GHC.Types.Id import GHC.Cmm.Graph import GHC.Types.Name -import GHC.Stg.Syntax import GHC.Core.Type import GHC.Builtin.Types.Prim import GHC.Types.Unique.FM @@ -162,22 +158,6 @@ cgLookupPanic id ]) --------------------- -getArgAmode :: NonVoid StgArg -> FCode CmmExpr -getArgAmode (NonVoid (StgVarArg var)) = idInfoToAmode <$> getCgIdInfo var -getArgAmode (NonVoid (StgLitArg lit)) = CmmLit <$> cgLit lit - -getNonVoidArgAmodes :: [StgArg] -> FCode [CmmExpr] --- NB: Filters out void args, --- so the result list may be shorter than the argument list -getNonVoidArgAmodes [] = return [] -getNonVoidArgAmodes (arg:args) - | isVoidRep (argPrimRep arg) = getNonVoidArgAmodes args - | otherwise = do { amode <- getArgAmode (NonVoid arg) - ; amodes <- getNonVoidArgAmodes args - ; return ( amode : amodes ) } - - ------------------------------------------------------------------------ -- Interface functions for binding and re-binding names ------------------------------------------------------------------------ |