[GHC] #12472: "lazy" is not optimized away

#12472: "lazy" is not optimized away
-------------------------------------+-------------------------------------
Reporter: ezyang | Owner: ezyang
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.1
Keywords: | Operating System: Unknown/Multiple
Architecture: | Type of failure: None/Unknown
Unknown/Multiple |
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Rev(s): | Wiki Page:
-------------------------------------+-------------------------------------
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

#12472: "lazy" is not optimized away -------------------------------------+------------------------------------- Reporter: ezyang | Owner: ezyang Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2444 Wiki Page: | -------------------------------------+------------------------------------- Changes (by ezyang): * status: new => patch * differential: => Phab:D2444 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12472#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12472: "lazy" is not optimized away
-------------------------------------+-------------------------------------
Reporter: ezyang | Owner: ezyang
Type: bug | Status: patch
Priority: normal | Milestone:
Component: Compiler | Version: 8.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D2444
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Edward Z. Yang

#12472: "lazy" is not optimized away -------------------------------------+------------------------------------- Reporter: ezyang | Owner: ezyang Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2444 Wiki Page: | -------------------------------------+------------------------------------- Changes (by ezyang): * status: patch => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12472#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12472: "lazy" is not optimized away -------------------------------------+------------------------------------- Reporter: ezyang | Owner: ezyang Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2444 Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): A variant of the patch from comment:2 was merged to `ghc-8.0` to allow for easy merging of the fix for #12076. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12472#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC