CorePrep: Top-level floats are LclIds
While staring at some output of CorePrep, I realised that bindings that CorePrep floats to top-level stay LocalId
s:
test :: String
test = "hi there, " ++ go 0 "pal!"
where
go 0 = id
go n = go (n-1)
With -O0 (the bigger example I had was with -O1), we generate a LclId
at the top-level
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
sat_sQp :: [GHC.Types.Char]
[LclId]
sat_sQp = GHC.CString.unpackCString# "hi there, "#
which is in contrast to Note [GlobalId/LocalId]
:
After CoreTidy, top-level LocalIds are turned into GlobalIds
(The LclId
persists until STG, so presumably it is also a LclId after CoreTidy.)