great (detailed) article about GHC + LLVM

I found this interesting:

David Terei sent it a few days ago too, as part of another thread.
(which prevented me of sharing too) :wink:

It's really interesting how the optimizations scrambled the code to a
point of non-recognition, but making it much faster. Are the generic
optimizations (also) tailored towards functional programming or was it
just coincidence/luck?


Reclaim your digital rights, eliminate DRM, learn more at

Just coincidence. A better way of looking at it is that the generic optimizations are tailored to produce code that runs fast on a given CPU. While it is still clearly important to do language specific or language directed optimizations, one goal of LLVM is to support many languages well. I suspect that if we spent real time tuning code coming out of GHC that LLVM could do even better,