Stream: cranelift

Topic: Low level docs


view this post on Zulip Carlo Kok (Mar 18 2024 at 13:47):

Does cranelift have some low level docs on how the different passes and subsystems work?

view this post on Zulip Carlo Kok (Mar 18 2024 at 13:49):

on the level of first we do dce whichh identifies callers and removes dead code

view this post on Zulip Till Schneidereit (Mar 18 2024 at 14:27):

in a case of excellent timing, LWN just published an article on Cranelift today that explains this at a high level: https://lwn.net/SubscriberLink/964735/8b795f23495af1d4/

view this post on Zulip Till Schneidereit (Mar 18 2024 at 14:28):

(not low-level as you asked, but it answers at least the fundamental question of how passes work)

view this post on Zulip Till Schneidereit (Mar 18 2024 at 14:29):

for actually low-level details, @Chris Fallin wrote a blog post going into quite some detail on how the compiler uses ISLE to implement optimization passes: https://cfallin.org/blog/2023/01/20/cranelift-isle/

view this post on Zulip Carlo Kok (Mar 18 2024 at 14:39):

Perfect..thanks

view this post on Zulip Chris Fallin (Mar 18 2024 at 15:44):

@Carlo Kok earlier blog posts in that series also go over various bits, and the module-level doc-comments try to be useful too; docs are always a place we could improve though so please do let us know what's confusing or unclear and we can try to fill in the gaps!

view this post on Zulip Chris Fallin (Mar 18 2024 at 15:44):

Also thanks Till for that link; neat, good PR; but never read the comments, see "Writing a compiler is not a hard problem" :-)

view this post on Zulip Carlo Kok (Mar 18 2024 at 15:53):

Been tracking this project for years. Love the work you all did. Above wasn't a complaint about the docs more that im really curious about the current architecture after the isle changes. Those blog posts are perfect.

view this post on Zulip Chris Fallin (Mar 18 2024 at 15:55):

For sure! outside perspectives are also really useful as a signal on doc usefulness so we're definitely open to your thoughts/confusions if any

view this post on Zulip Carlo Kok (Mar 18 2024 at 15:56):

I've done a basic ir to native code bit in the past. My approach was a lot simpler (but that's fine it was only to see if I could do it. Not for real use.) I love blog posts like this


Last updated: Dec 23 2024 at 12:05 UTC