Re: [GHC] #2416: Optimization defeated by merging module into main

2010-06-24 Thread GHC
#2416: Optimization defeated by merging module into main
---+
  Reporter:  sedillard |  Owner:
  Type:  bug   | Status:  closed
  Priority:  low   |  Milestone:  6.14.1
 Component:  Compiler  |Version:  6.8.3 
Resolution:  fixed |   Keywords:
Difficulty:  Unknown   | Os:  Linux 
  Testcase:|   Architecture:  x86_64 (amd64)
   Failure:  None/Unknown  |  
---+
Changes (by kfrdbs):

 * cc: kfr...@… (added)


-- 
Ticket URL: 
GHC 
The Glasgow Haskell Compiler
___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #2416: Optimization defeated by merging module into main

2010-06-24 Thread GHC
#2416: Optimization defeated by merging module into main
---+
  Reporter:  sedillard |  Owner:
  Type:  bug   | Status:  closed
  Priority:  low   |  Milestone:  6.14.1
 Component:  Compiler  |Version:  6.8.3 
Resolution:  fixed |   Keywords:
Difficulty:  Unknown   | Os:  Linux 
  Testcase:|   Architecture:  x86_64 (amd64)
   Failure:  None/Unknown  |  
---+
Changes (by igloo):

  * status:  new => closed
  * failure:  => None/Unknown
  * resolution:  => fixed


Comment:

 Performance of both is now the same, and both have `D#`s in the `-ddump-
 simpl` output.

-- 
Ticket URL: 
GHC 
The Glasgow Haskell Compiler
___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #2416: Optimization defeated by merging module into main

2009-04-13 Thread GHC
#2416: Optimization defeated by merging module into main
---+
Reporter:  sedillard   |Owner: 
Type:  bug |   Status:  new
Priority:  normal  |Milestone:  6.12 branch
   Component:  Compiler|  Version:  6.8.3  
Severity:  normal  |   Resolution: 
Keywords:  |   Difficulty:  Unknown
Testcase:  |   Os:  Linux  
Architecture:  x86_64 (amd64)  |  
---+
Changes (by igloo):

  * milestone:  6.10 branch => 6.12 branch

-- 
Ticket URL: 
GHC 
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #2416: Optimization defeated by merging module into main

2009-01-05 Thread GHC
#2416: Optimization defeated by merging module into main
---+
Reporter:  sedillard   |Owner: 
Type:  bug |   Status:  new
Priority:  normal  |Milestone:  6.10 branch
   Component:  Compiler|  Version:  6.8.3  
Severity:  normal  |   Resolution: 
Keywords:  |   Difficulty:  Unknown
Testcase:  |   Os:  Linux  
Architecture:  x86_64 (amd64)  |  
---+
Comment (by simonpj):

 Indeed #2422 is a much more tractable example.  No point in looking at
 #2416 further until #2422 is dealt with.

 Simon

-- 
Ticket URL: 
GHC 
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #2416: Optimization defeated by merging module into main

2008-07-05 Thread GHC
#2416: Optimization defeated by merging module into main
---+
 Reporter:  sedillard  |  Owner:
 Type:  bug| Status:  new   
 Priority:  normal |  Milestone:  6.10 branch   
Component:  Compiler   |Version:  6.8.3 
 Severity:  normal | Resolution:
 Keywords: | Difficulty:  Unknown   
 Testcase: |   Architecture:  x86_64 (amd64)
   Os:  Linux  |  
---+
Changes (by igloo):

  * milestone:  => 6.10 branch

-- 
Ticket URL: 
GHC 
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #2416: Optimization defeated by merging module into main

2008-07-05 Thread GHC
#2416: Optimization defeated by merging module into main
---+
 Reporter:  sedillard  |  Owner:
 Type:  bug| Status:  new   
 Priority:  normal |  Milestone:
Component:  Compiler   |Version:  6.8.3 
 Severity:  normal | Resolution:
 Keywords: | Difficulty:  Unknown   
 Testcase: |   Architecture:  x86_64 (amd64)
   Os:  Linux  |  
---+
Comment (by sedillard):

 I've filed the original `Storable` weirdness as #2422. In trying to narrow
 it down some more I also discovered #2420, which may or may not be
 related.

-- 
Ticket URL: 
GHC 
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #2416: Optimization defeated by merging module into main

2008-07-04 Thread GHC
#2416: Optimization defeated by merging module into main
---+
 Reporter:  sedillard  |  Owner:
 Type:  bug| Status:  new   
 Priority:  normal |  Milestone:
Component:  Compiler   |Version:  6.8.3 
 Severity:  normal | Resolution:
 Keywords: | Difficulty:  Unknown   
 Testcase: |   Architecture:  x86_64 (amd64)
   Os:  Linux  |  
---+
Comment (by sedillard):

 Added new, smaller test case. MainOnly.hs, LibOnly.hs and MainAndLib.hs.
 The problem is definitely with the Storable instance. In MainAndLib none
 of the methods are inlined, in MainOnly they are.

-- 
Ticket URL: 
GHC 
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #2416: Optimization defeated by merging module into main

2008-07-04 Thread GHC
#2416: Optimization defeated by merging module into main
---+
 Reporter:  sedillard  |  Owner:
 Type:  bug| Status:  new   
 Priority:  normal |  Milestone:
Component:  Compiler   |Version:  6.8.3 
 Severity:  normal | Resolution:
 Keywords: | Difficulty:  Unknown   
 Testcase: |   Architecture:  x86_64 (amd64)
   Os:  Linux  |  
---+
Comment (by simonpj):

 If you can boil down your Storable problem, do put it in a separate Trac
 ticket.

 S

-- 
Ticket URL: 
GHC 
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #2416: Optimization defeated by merging module into main

2008-07-04 Thread GHC
#2416: Optimization defeated by merging module into main
---+
 Reporter:  sedillard  |  Owner:
 Type:  bug| Status:  new   
 Priority:  normal |  Milestone:
Component:  Compiler   |Version:  6.8.3 
 Severity:  normal | Resolution:
 Keywords: | Difficulty:  Unknown   
 Testcase: |   Architecture:  x86_64 (amd64)
   Os:  Linux  |  
---+
Comment (by sedillard):

 Thanks for looking into it. It has something to do with the Storable
 instance. I've noticed consistently flaky behavior from the combination of
 that class and my vector data type. Until the NDP array libraries mature,
 or until someone helps me with this [http://www.haskell.org/pipermail
 /haskell-cafe/2008-July/044879.html], Storable is all I've got and I use
 it heavily.

 Originally, I meant to submit another bug, and I was trying to create a
 simple test case, which is when I ran across this behavior while trying to
 merge everything into one file. That original bug, also involving
 Storable, is even weirder:

 I have a type Vec4 a, which is polymorphic in a, and a Storable instance
 for that. (Same as in this file.) I also have a specialized types, Vec2D -
 Vec4D, with unpacked doubles, and functions pack/unpack which convert
 between the polymorphic and specialized types. The weirdness is this: when
 I declare a Storable instance for Vec2D, using pack/unpack and the
 Storable methods of Vec2 a, then the optimization fails for Vec4 a's
 Storable methods. The test case is the same as here, Main.hs doing many
 4x4 matrix/vector multiplies. So when I define type B's Storable instance
 using type A's, then optimization fails for type A's methods, even though
 no values of type B are ever used. Totally bizarre. I can reproduce this,
 but like I said, I ran into this here bug when trying to make a single-
 file test case, so first things first I guess.

-- 
Ticket URL: 
GHC 
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #2416: Optimization defeated by merging module into main

2008-07-04 Thread GHC
#2416: Optimization defeated by merging module into main
---+
 Reporter:  sedillard  |  Owner:
 Type:  bug| Status:  new   
 Priority:  normal |  Milestone:
Component:  Compiler   |Version:  6.8.3 
 Severity:  normal | Resolution:
 Keywords: | Difficulty:  Unknown   
 Testcase: |   Architecture:  x86_64 (amd64)
   Os:  Linux  |  
---+
Changes (by simonpj):

  * difficulty:  => Unknown

Comment:

 Thank you very much for a nice test case.  Usually splitting things across
 modules makes things worse, not better, so it's an interesting case.

 I'll look into it.  But probably not immediately -- POPL deadline then
 trip.

 Simon

-- 
Ticket URL: 
GHC 
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #2416: Optimization defeated by merging module into main

2008-07-03 Thread GHC
#2416: Optimization defeated by merging module into main
---+
Reporter:  sedillard   |Owner:   
Type:  bug |   Status:  new  
Priority:  normal  |Milestone:   
   Component:  Compiler|  Version:  6.8.3
Severity:  normal  |   Resolution:   
Keywords:  | Testcase:   
Architecture:  x86_64 (amd64)  |   Os:  Linux
---+
Comment (by sedillard):

 Adding

   `module Main (main) where`

 does not change the behavior.

-- 
Ticket URL: 
GHC 
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #2416: Optimization defeated by merging module into main

2008-07-03 Thread GHC
#2416: Optimization defeated by merging module into main
---+
Reporter:  sedillard   |Owner:   
Type:  bug |   Status:  new  
Priority:  normal  |Milestone:   
   Component:  Compiler|  Version:  6.8.3
Severity:  normal  |   Resolution:   
Keywords:  | Testcase:   
Architecture:  x86_64 (amd64)  |   Os:  Linux
---+
Comment (by dolio):

 What happens if you put:

 {{{ module Main (main) where }}}

 at the top of Both.hs? The obvious difference between the two setups is
 that Main.hs exports only main, m4 and v4, whereas Both exports all the
 functions in TheModule as well. When things are exported like that, GHC is
 more conservative about optimizations.

-- 
Ticket URL: 
GHC 
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #2416: Optimization defeated by merging module into main

2008-07-03 Thread GHC
#2416: Optimization defeated by merging module into main
---+
Reporter:  sedillard   |Owner:   
Type:  bug |   Status:  new  
Priority:  normal  |Milestone:   
   Component:  Compiler|  Version:  6.8.3
Severity:  normal  |   Resolution:   
Keywords:  | Testcase:   
Architecture:  x86_64 (amd64)  |   Os:  Linux
---+
Comment (by sedillard):

 The main reason Main.hs is so much faster is this:

 {{{
 ghc --make Main.hs -O2 -fexcess-precision -ddump-simpl | grep D#
 [1 of 2] Compiling TheModule( TheModule.hs, TheModule.o )
 [2 of 2] Compiling Main ( Main.hs, Main.o )
 Linking Main ...
 (no hits)
 }}}

 There are no calls D# in the compiled Main.hs, whereas Both.hs ends up
 with many D# constructors in the main loop.

-- 
Ticket URL: 
GHC 
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


[GHC] #2416: Optimization defeated by merging module into main

2008-07-03 Thread GHC
#2416: Optimization defeated by merging module into main
---+
Reporter:  sedillard   |   Owner:  
Type:  bug |  Status:  new 
Priority:  normal  |   Component:  Compiler
 Version:  6.8.3   |Severity:  normal  
Keywords:  |Testcase:  
Architecture:  x86_64 (amd64)  |  Os:  Linux   
---+
 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 100
 20.0 :. (59.0 :. (100.0 :. (137.0 :. (

 real0m0.389s
 user0m0.152s
 sys 0m0.232s

 time ./Both 10
 20.0 :. (59.0 :. (100.0 :. (137.0 :. (

 real0m3.462s
 user0m3.368s
 sys 0m0.068s
 }}}

 So that makes Both about 100 times slower. Compiled with -O2 and -fexcess-
 precision

-- 
Ticket URL: 
GHC 
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs