Re: [arch-haskell] haskell-src-exts: Illegal instruction (core dumped)

On Sun, Apr 27, 2014 at 10:16:30PM +0200, Nicola Squartini wrote:
Is it possible that LLVM automatically optimizes for your architecture or triggers the use of some simd that is not present on my AMDs?
I suppose that might be the case. It is possible to pass options to specific parts of the compilation process, but I have never looked at any of this before so help would be very appreciated. /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus@therning.org jabber: magnus@therning.org twitter: magthe http://therning.org/magnus Perl is another example of filling a tiny, short-term need, and then being a real problem in the longer term. -- Alan Kay

I never used LLVM so I'm looking at the manual right now. It's explained
here:
http://llvm.org/docs/CommandGuide/llc.html#cmdoption-mcpu
It autodetects the cpu and optimizes for it.
As I understand, in order to produce generic code you should pass
-mcpu=i686 or -mcpu=x86_64. They can be passed to the ghc via -optlc, e.g.
-optlc="-mcpu=x86_64".
I'm going to look more carefully to see what is the best option to pass.
On Sun, Apr 27, 2014 at 10:32 PM, Magnus Therning
On Sun, Apr 27, 2014 at 10:16:30PM +0200, Nicola Squartini wrote:
Is it possible that LLVM automatically optimizes for your architecture or triggers the use of some simd that is not present on my AMDs?
I suppose that might be the case. It is possible to pass options to specific parts of the compilation process, but I have never looked at any of this before so help would be very appreciated.
/M
-- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus@therning.org jabber: magnus@therning.org twitter: magthe http://therning.org/magnus
Perl is another example of filling a tiny, short-term need, and then being a real problem in the longer term. -- Alan Kay

On Sun, Apr 27, 2014 at 11:11:25PM +0200, Nicola Squartini wrote:
I never used LLVM so I'm looking at the manual right now. It's explained here:
http://llvm.org/docs/CommandGuide/llc.html#cmdoption-mcpu
It autodetects the cpu and optimizes for it. As I understand, in order to produce generic code you should pass -mcpu=i686 or -mcpu=x86_64. They can be passed to the ghc via -optlc, e.g. -optlc="-mcpu=x86_64". I'm going to look more carefully to see what is the best option to pass.
Thanks for looking into it. This does makes me wonder though what other differences there are between the two code generators. Maybe it's worth considering using LLVM for all packages? /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus@therning.org jabber: magnus@therning.org twitter: magthe http://therning.org/magnus What gets measured, gets done. -- Tom Peters

I remember reading somewhere that packages that use parallelism, like
`repa`, would benefit from the llvm backend. I've never seen benchmarks
though.
On Sun, Apr 27, 2014 at 11:55 PM, Magnus Therning
On Sun, Apr 27, 2014 at 11:11:25PM +0200, Nicola Squartini wrote:
I never used LLVM so I'm looking at the manual right now. It's explained here:
http://llvm.org/docs/CommandGuide/llc.html#cmdoption-mcpu
It autodetects the cpu and optimizes for it. As I understand, in order to produce generic code you should pass -mcpu=i686 or -mcpu=x86_64. They can be passed to the ghc via -optlc, e.g. -optlc="-mcpu=x86_64". I'm going to look more carefully to see what is the best option to pass.
Thanks for looking into it.
This does makes me wonder though what other differences there are between the two code generators. Maybe it's worth considering using LLVM for all packages?
/M
-- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus@therning.org jabber: magnus@therning.org twitter: magthe http://therning.org/magnus
What gets measured, gets done. -- Tom Peters

On Mon, Apr 28, 2014 at 12:08:08AM +0200, Nicola Squartini wrote:
I remember reading somewhere that packages that use parallelism, like `repa`, would benefit from the llvm backend. I've never seen benchmarks though.
Ah, sounds interesting. What I have read in some old haskell-cafe posts is that the generated code is better in some (even many) cases, but that compilation takes longer. I've also not seen any benchmarks. /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus@therning.org jabber: magnus@therning.org twitter: magthe http://therning.org/magnus Any fool can write code that a computer can understand. Good programmers write code that humans can understand. -- Martin Fowler
participants (2)
-
Magnus Therning
-
Nicola Squartini