Ticket #2823 (new bug)

Opened 3 years ago

Last modified 4 months ago

Another arity expansion bug

Reported by: simonpj Owned by:
Priority: lowest Milestone: 7.6.1
Component: Compiler Version: 6.10.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Runtime performance bug Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

Roman reports: I've finally tracked down one big optimisation problem (at least, I think it is big). Here is a small example:

foo :: Eq a => a -> a
{-# NOINLINE foo #-}
foo x = x

bar :: Eq a => a -> a
{-# INLINE [1] bar #-}
bar x = let p = foo (x,x)
             q = foo (p,p) in fst (fst q)

For some reason, bar's arity is 1 which is wrong. If we replace (fst (fst q)) by (fst p), it gets the correct arity of 2.

The problem is that because of the arity, (bar $dEq) is then floated out as far as possible which breaks fusion if we have RULES for bar. In case you are interested, this affects splitSD in `dph-prim-par/Data/ Array/Parallel/Unlifted/Distributed/Arrays.hs`. I haven't noticed this previously because we didn't use segmented arrays as much.

Change History

Changed 3 years ago by igloo

  • milestone set to 6.10.2

Changed 3 years ago by igloo

  • milestone changed from 6.10.2 to 6.12 branch

Changed 3 years ago by simonmar

  • failure set to Runtime performance bug

Changed 2 years ago by igloo

  • milestone changed from 6.12 branch to 6.12.3

Changed 2 years ago by igloo

  • priority changed from normal to low
  • milestone changed from 6.12.3 to 6.14.1

Changed 18 months ago by igloo

  • milestone changed from 7.0.1 to 7.0.2

Changed 15 months ago by igloo

  • milestone changed from 7.0.2 to 7.2.1

Changed 8 months ago by igloo

  • milestone changed from 7.2.1 to 7.4.1

Changed 4 months ago by igloo

  • priority changed from low to lowest
  • milestone changed from 7.4.1 to 7.6.1
Note: See TracTickets for help on using tickets.