Opened 2 years ago

Last modified 2 years ago

#13694 new bug

CSE runs before SpecConstr

Reported by: mpickering Owned by:
Priority: normal Milestone:
Component: Compiler Version: 8.0.1
Keywords: SpecConstr, CSE Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


SpecConstr can lead to more CSE opportunities. Currently CSE is run only once after the full laziness transformation but then not again later in the pipeline. Running it again after the final clean-up simplification might lead to smaller programs.

One example with -fspec-constr-keen.

module Foo where

main :: [Int]
main = drop 1 [1,2]

mainMODULE :: [Int]
mainMODULE = mydrop 1 [1,2]

mydrop :: Int -> [a] -> [a]
mydrop 0 xs = xs
mydrop n (x:xs) = mydrop (n-1) xs

Change History (1)

comment:1 Changed 2 years ago by simonpj

Keywords: CSE added; cse removed

Good plan. Would you like to try it out? (Certainly with -O2.) CSE is pretty cheap.

It'd need a before-and-after nofib run to confirm any effects.



Note: See TracTickets for help on using tickets.