"lazy" is not optimized away
Consider:
import GHC.Magic
{-# INLINE f #-}
f x = True
g = lazy f False
Two things should happen: (1) f should not be inlined, but (2) lazy should not be present in final STG (having been eliminated in core prep). I thought this was briefly working on HEAD, but apparently it never worked at all:
ezyang@sabre:~$ ghc-8.0 -c test.hs -ddump-stg -fforce-recomp -O2
==================== STG syntax: ====================
Test.f [InlPrag=INLINE (sat-args=1)]
:: forall t_axB. t_axB -> GHC.Types.Bool
[GblId,
Arity=1,
Caf=NoCafRefs,
Str=DmdType <L,A>,
Unf=OtherCon []] =
\r srt:SRT:[] [eta_sHD] GHC.Types.True [];
Test.g :: GHC.Types.Bool
[GblId, Str=DmdType] =
\u srt:SRT:[] [] GHC.Magic.lazy Test.f GHC.Types.False;
Clearly it has not been eliminated.
Trac metadata
Trac field | Value |
---|---|
Version | 8.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |