Comment

Comment by mathisfun123

>Like what exactly is the implementation of the top 20 optimizations? It can’t be that high right..

I love the full-throated arrogance of this - "I have no idea but I'm sure it's not hard" lol

So I'll tell you - each pass is at minimum a paper (mem2reg) and at maximum several dissertations (polly) to understand. Then have fun implementing a basic basic alpha in your compiler that doesn't have all the creature comforts of LLVM - iterators, efficient data-structures, debugging aids, etc. And then give up because a paper or a dissertation is out-of-date like as soon as it's in deadtree form, while LLVM is a living, breathing, tapestry of insights, breakthroughs, and hacks too.

I highly recommend you attempt even one pass to get a feel: pick any language that has a parser impl and design an IR for it and then optimize it (designing an IR from scratch can't be that hard can it?)

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton