TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

How GHC and LLVM work together, and how they can improve

43 pointsby donsover 13 years ago

1 comment

larsbergover 13 years ago
Thanks for all the details! We're looking at moving from MLRISC to LLVM in Manticore, and some knowledge of the pitfalls in the terrain are definitely helpful. We're most worried about our ridiculously custom calling convention while in-ML, but the optimization limitations are good to hear about.<p>For your point #3 ("Haskell itself"), do you do any block coalescing? In Manticore, once we're in our final IR before codegen (basically a first-order CPS language), we have a few tricks to help our code generator out from this:<p>1) If f only calls g and g is only called by f, merge the two blocks. During the merge, add the gc check for g to the top of the entire block. This optimization is extremely effective, but only because of our control-flow analysis results, since so many of our jumps are indirect.<p>2) Don't split blocks or do multiple GC checks in a block where one will do. So, if you allocate multiple small tuples, do a single GC check for all the space you will need in the block.<p>I'm sure John probably mentioned these to the Simons, but just in case...
评论 #3061847 未加载