id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,os,architecture,failure,difficulty,testcase,blockedby,blocking,related
2416,Optimization defeated by merging module into main,sedillard,,"I have a library, `TheModule`, and an application that uses `TheModule`, called `Main`. When `TheModule` lives in `TheModule.hs` and `Main` lives in `Main.hs`, optimization works as expected. When I copy all of `TheModule`'s definitions and all of `Main`'s definitions into `Both.hs`, much less optimization occurs, as can be seen from -ddump-simpl, as well as the drastic difference in running times. 

The program performs a lot of small matrix-vector multiplications. The single command line argument tells how many to do. 

{{{
time ./Main 1000000
20.0 :. (59.0 :. (100.0 :. (137.0 :. ())))

real	0m0.389s
user	0m0.152s
sys	0m0.232s

time ./Both 100000
20.0 :. (59.0 :. (100.0 :. (137.0 :. ())))

real	0m3.462s
user	0m3.368s
sys	0m0.068s
}}}

So that makes Both about 100 times slower. Compiled with -O2 and -fexcess-precision",bug,closed,low,7.0.1,Compiler,6.8.3,fixed,,,Linux,x86_64 (amd64),None/Unknown,Unknown,,,,
