3 ms·
Funny that there was no mention of GCC, since it was probably one of the first IRs that anyone encountered IRL. If I remember correctly one motivation for Clang
by manv1 4y ago
Funny that there was no mention of GCC, since it was probably one of the first IRs that anyone encountered IRL. If I remember correctly one motivation for Clang/LLVM was because GCC's IR was so bad.
I knew people that wrote backends for gcc, and they pretty much all agreed it was a nightmare.
- pjmlp 4y agoOne of the first IRs was the PL.8 compiler, and the Amsterdam Compiler Toolkit, both predate GCC for quite a while.
- vkazanov 4y agoI think advanced fortran compilers already used IRs by late 60s, early 70s. Most compilers in the 80s already used some form of non-ast IRs: Generalised portable instructions, cfg representations, etc. I'd say that back then people were experimenting with various forms of IRs for optimization purposes. By 90s it was typical for compilers to have several IRs. Gcc belongs to this compiler generation. 2000s is the time when IRs standardised around 2-3 SSA-like forms, which made it possible to do most optimisation work on this level only.
- pjmlp 4y agoI got curious by your remark and found this Fortran compiler from 1962, using an IR that they call BAS (Binary and Arbitrarily Symbolic). http://www.chilton-computing.org.uk/acl/applications/hartran/p022.htm http://www.chilton-computing.org.uk/acl/applications/hartran...
- vkazanov 4y agoTBH, I just speculated. I remember 60s ibm research publications on cfg, optimizations against it and was pretty sure these things are very hard to do on an ast or those simpler line by line compilers popular back then. In fact, even the original fortran had quite an involved compiler, complete with numerous optimisations and sophisticated register allocation. Fun read, btw.