Please read this post by CatalystMaker
here
Something very important that he says.
Quote:
The second comment I would like to relate that to is from Tim Sweeney, the lead developer for the UT games. (also found on Beyond3d)
".. any code optimization performed on a function that does not change the resulting value of the function for any argument, is uncontroversially considered a valid optimization. "
That guys is exactly what we did. We optimized the code without changing the end resutl.
|
Notice that he is quoting Tim Sweeney. Notice that Sweeney says that any function that has the same result as the original for
any argument is a valid optimization. Then notice that CatalystMaker says that is exactly what they did.
Now look at your example. It does not have the same output for every argument. If c = false then you are skipping instructions.