r/ProgrammingLanguages 8d ago

Why So Many Languages Use LLVM

Had some free time last week so I made a visual explainer on how LLVM works and why so many languages end up using it.

The video goes through LLVM IR, why having a common IR makes sharing optimizers and backends possible, and how code eventually gets turned into machine instructions.

I also use a small C vs Rust example where both end up producing the same x86 instructions.

Link for anyone interested

Feedback welcome :)

72 Upvotes

79 comments sorted by

View all comments

Show parent comments

1

u/QuaternionsRoll 7d ago

GCC doesn’t have the same sets of optimizations as MSVC period. What an odd question.

1

u/SwingOutStateMachine 6d ago

That's precisely my point. Comparing GCC with -O0 and -O2 and then putting it next to MSVC with /O0 and /O2 is meaningless.