4 ms·
I hope it is some kind of a joke. It is not responsibility of a compiler to recognize specific problems in specific domains and perform optimizations, it is a
by mynegation 15y ago
I hope it is some kind of a joke.
It is not responsibility of a compiler to recognize specific problems in specific domains and perform optimizations, it is a job for a human programmer. Sure, you can make compiler aware of Riemann zeta function values in specific ranges, but what's the use of that outside of very specialized programs? Optimizations mentioned in the article could be programmed in C and compiler would happily translate these savings into assembly.
The reasons why we don't really program assembly anymore is that _on average and on a large scale_ compilers generate vastly better machine code than humans. Take for example register allocation problem which is proven to be NP-complete. Obviously compiler does an approximated algorithm but save for a case of few registers, no human can match it.
Some architectures, like VLIW, actually rely on the compiler to generate well-performing machine code.