[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 <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. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12472> 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: | -------------------------------------+------------------------------------- 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 <ezyang@…>): In [changeset:"0d3bf62092de83375025edca6f7242812338542d/ghc" 0d3bf62/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="0d3bf62092de83375025edca6f7242812338542d" Fix #12472 by looking for noinline/lazy inside oversaturated applications. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonpj, austin, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2444 GHC Trac Issues: #12472 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12472#comment:2> 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: | -------------------------------------+------------------------------------- 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