Posted: Fri Nov 06, 2009 11:03 am Post subject: Compiler Source Code Optimization
I found a link to these lecture slides on Reddit. They deal with some fairly advanced topics in assembly and compilers, but I think that most CS students in 2nd or 3rd year should be able to pick up on most of the content, particularly those who have taken the introduction-to-compilers course (CS241 at UWaterloo) and the introduction-to-CPU-hardware (CS251 at UWaterloo).
All the examples are written in C, but in general the code isn't bad to understand.
Short version: In general, you aren't going to do better than the compiler with silly tricks unless you really, really, really know what you're doing. Unless you're prepared to learn about all the fiddly details, avoid obfuscation-for-optimisation and write clean code.
Sponsor Sponsor
Tony
Posted: Fri Nov 06, 2009 2:59 pm Post subject: Re: Compiler Source Code Optimization
DemonWasp @ Fri Nov 06, 2009 11:03 am wrote:
you aren't going to do better than the compiler
And if you can, then that should probably go into the compiler itself. I can't wait to take CS444 (4th year compilers), it will be awesome.
Posted: Fri Nov 06, 2009 3:19 pm Post subject: RE:Compiler Source Code Optimization
A valid point. Reading this paper made me wish for the day I get to take that course...and it also made me want to work on gcc, because apparently it produces some ridiculously awesome code for lots of things.