[GHC] #13369: Float-out is not idempotent
#13369: Float-out is not idempotent -------------------------------------+------------------------------------- Reporter: simonpj | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.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 {{{ f x = BIG }}} where BIG is bottoming. In HEAD, the float-out pass decides to float BIG to the top level, producing {{{ lvl x = BIG f x = lvl x }}} which is obviously stupid. There's a whole Note to explain this problem and how we avoid it: {{{ Note [Floating from a RHS] ~~~~~~~~~~~~~~~~~~~~~~~~~~ When float the RHS of a let-binding, we don't always want to apply lvlMFE to the body of a lambda, as we usually do, because the entire binding body is already going to the right place (dest_lvl). A particular example is the top level. Consider concat = /\ a -> foldr ..a.. (++) [] We don't want to float the body of the lambda to get lvl = /\ a -> foldr ..a.. (++) [] concat = /\ a -> lvl a That would be stupid. }}} But I forgot to take account of the possibility that `abs_vars` might abstract over Ids. Easily fixed. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13369> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13369: Float-out is not idempotent -------------------------------------+------------------------------------- Reporter: simonpj | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.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): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Simon Peyton Jones <simonpj@…>): In [changeset:"fb9ae288088a3eabc4e1bb4e86fa473a3881d2e2/ghc" fb9ae288/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="fb9ae288088a3eabc4e1bb4e86fa473a3881d2e2" Make FloatOut/SetLevels idemoptent on bottoming functions This fixes Trac #13369. It turned out that I really had got the bottoming-float code wrong, again. The new story is explained in Note [Bottoming floats], esp item (3), and Note [Floating from a RHS]. I didn't make a regression test; it's hard to to so. Nofib result are good -------------------------------------------------------------------------------- Program Size Allocs Runtime Elapsed TotalMem -------------------------------------------------------------------------------- banner -2.2% -4.6% 0.00 0.00 +0.0% bspt -1.3% -1.6% 0.01 0.01 +0.0% cacheprof -1.8% -0.3% +3.7% +3.7% -0.9% digits-of-e2 -1.0% -1.5% -0.5% -0.5% +0.0% expert -1.3% -0.2% 0.00 0.00 +0.0% n-body -1.1% -0.2% +0.1% +0.1% +0.0% veritas -2.9% -0.1% 0.00 0.00 +0.0% -------------------------------------------------------------------------------- Min -2.9% -4.6% -7.4% -7.4% -19.8% Max -1.0% +0.0% +5.2% +5.1% +10.0% Geometric Mean -1.2% -0.1% +0.5% +0.5% -0.1% I /think/ all this is due to this error-floating change; but it's possible that some was due to commit "Fix CSE (again) on literal strings" a couple of commits earlier. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13369#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13369: Float-out is not idempotent -------------------------------------+------------------------------------- Reporter: simonpj | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.0.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): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => closed * resolution: => fixed -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13369#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC