I have added a new page on how compilers implement conditional statements and loops. It still needs extensive improvement, but I will continue working on it.
There is a standing plan to (eventually) create a separate wiki and forum for language design and compiler development. To this end, the OS wiki group established a set of pages for bootstrapping it, to be temporary hosted here.
No one else has worked on it for a while, as there hasn't been the necessary interest, but it is still there as there hasn't been any reason to remove it, and the specifics of compiler optimization do come up in OS dev.
A few days ago, the subject of what kind of code is generated for certain language constructs came up in the fora, and was relevant to OS dev (because a question arose about efficiency for explicit loops versus gotos - one of the posters was using goto extensively on this basis, and we were able to show that it was not faster in general), so I thought it would make sense to add this as a (sort of) permanent part of the CompilerDev wiki project.
New pages added to Project CompilerDev
- Schol-R-LEA
- Member
- Posts: 1925
- Joined: Fri Oct 27, 2006 9:42 am
- Location: Athens, GA, USA
New pages added to Project CompilerDev
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.
Re: New pages added to Project CompilerDev
The transformation you are outlining at the end of the article is called loop inversion. Along with other control-flow optimizations it is nicely described and evaluated in Steven Muchnick's Advanced Compiler Design & Implementation (chapter 18). If simplicifation is also described there.