> Is this me opening up a Pandora's Box of ignorance here? Or is LLVM > potentially interesting? (And were someone motivated into perhaps > trying to make an LLVM back-end, where would one start to poke around > in, say, the GHC codebase to even begin to implement this? And how > insane would they be driven by the process?)
Apologies for the slow reply. Actually I think this is a pretty cool idea (with a disclaimer that I know very nearly nothing about LLVM). Provided there are no serious gotchas, what you need to do is write a new backend for GHC that translates Cmm to LLVM. This should be pretty straightforward: for example, the Cmm->C code generator is only 1000 lines of Haskell: http://darcs.haskell.org/ghc/compiler/cmm/PprC.hs I hope LLVM lets you put data next to code, which is what GHC needs for its info tables. Also I hope it lets you fix global registers.
-- Michael T. Richter Email: ttmrichter@gmail.com, mtr1966@hotpop.com MSN: ttmrichter@hotmail.com, mtr1966@hotmail.com; YIM: michael_richter_1966; AIM: YanJiahua1966; ICQ: 241960658; Jabber: mtr1966@jabber.cn "To [the Chinese], all other people are barbarians." --The Dalai Lama |