Re: -optc-O2 considered useful

2008-05-20 Thread Bernd Brassel
I think it would be nice to have some speedy optimizations turned on by default in ghc. Might even be good to win new users. But I also think that much hacking for and around ghc+tool support needs a way to achieve what -O0 does today. So, how about an -O(-1) or flag?

Re: -optc-O2 considered useful

2008-05-16 Thread Simon Marlow
Don Stewart wrote: duncan.coutts: On Thu, 2008-05-15 at 23:00 +0400, Bulat Ziganshin wrote: Hello Don, Thursday, May 15, 2008, 10:47:20 PM, you wrote: I discovered something today I didn't know. gcc -O2 can optimise out the computed jumps GHC produces in tight loops. seems that decision to

Re: -optc-O2 considered useful

2008-05-16 Thread Neil Mitchell
Hi As for the specific issue of whether we should turn on -fstrictness with -O0, I suspect the answer is that the compile-time cost would be too high. There would also be the issue that it would increase the amount of Haskell code which works only in GHC, which is probably a bad thing. Would

Re: -optc-O2 considered useful

2008-05-16 Thread Isaac Dupree
Simon Marlow wrote: This is part of a larger question, namely whether we can get substantial benefit for doing a tiny bit of extra work in -O0. With -O0 we're optimising for compile time in preference to code speed, although we do want to find a good compromise that doesn't generate abysmal

-optc-O2 considered useful

2008-05-15 Thread Don Stewart
I discovered something today I didn't know. gcc -O2 can optimise out the computed jumps GHC produces in tight loops. Consider this program, import Data.Array.Vector import Data.Bits main = print . sumU . mapU (*2) . mapU (`shiftL` 2)

Re: -optc-O2 considered useful

2008-05-15 Thread Bulat Ziganshin
Hello Don, Thursday, May 15, 2008, 10:47:20 PM, you wrote: I discovered something today I didn't know. gcc -O2 can optimise out the computed jumps GHC produces in tight loops. seems that decision to use native backend in ghc -O2 was too early? -- Best regards, Bulat

Re: -optc-O2 considered useful

2008-05-15 Thread Duncan Coutts
On Thu, 2008-05-15 at 23:00 +0400, Bulat Ziganshin wrote: Hello Don, Thursday, May 15, 2008, 10:47:20 PM, you wrote: I discovered something today I didn't know. gcc -O2 can optimise out the computed jumps GHC produces in tight loops. seems that decision to use native backend in ghc

Re: -optc-O2 considered useful

2008-05-15 Thread Don Stewart
duncan.coutts: On Thu, 2008-05-15 at 23:00 +0400, Bulat Ziganshin wrote: Hello Don, Thursday, May 15, 2008, 10:47:20 PM, you wrote: I discovered something today I didn't know. gcc -O2 can optimise out the computed jumps GHC produces in tight loops. seems that decision to