←back to thread

170 points signa11 | 1 comments | | HN request time: 0s | source
Show context
cube2222 ◴[] No.41086752[source]
At the compiler’s course in my university we just had the option to use either LLVM text format as the target, or assembly (for bonus points).

Frankly, I don’t see much point in a “special IR for teaching” because llvm text format is just really straightforward, and at the same time teaches the “real deal” (sure, normally you’d likely use bindings, but still).

You can still have your students reimplement optimizations that llvm would normally do by themselves (like inductive variable elimination, const propagation, dataflow analysis, using phi instead of alloc etc.).

At least I was really happy I could play with llvm for a university project.

replies(2): >>41086848 #>>41088898 #
mananaysiempre ◴[] No.41086848[source]
It sounds like you didn’t write optimizations operating on that format, though. This seems to have been a large part of the course TFA describes.
replies(2): >>41089858 #>>41092906 #
1. cube2222 ◴[] No.41092906[source]
Yeah that’s fair, you only target it, but would have an ad-hoc internal IR of your own making for optimizations.