2 ms·
Surely this is what optimizing compilers are for? Just put it in the source code, and if all the information required to calculate the constant is present at c
by dTal 6y ago
Surely this is what optimizing compilers are for?
Just put it in the source code, and if all the information required to calculate the constant is present at compile time - why, then the compiler should calculate it, and optimize away all that hairy math! No need for a separate "preprocessing" step, or a hairy template language.
- woofie11 6y agoFor the most part, no. Optimizing compilers can't do this. There are whole classes of problems one runs into from: - The ability to change variables by reference or through introspection - Exceptions in intermediate computations - Etc. The set of transformations one can do while maintaining guaranteed equivalence is limited.