3 ms·
If you read all the way into the comments, you'll see that this does happen -- but only for values of n that are quite small. And this is a side effect of other
by CurtHagenlocher 13y ago
If you read all the way into the comments, you'll see that this does happen -- but only for values of n that are quite small. And this is a side effect of other optimizations -- not because of anything specific to this closed form.
- sharth 13y agoYeah, I was just now skimming through the comments as well and I saw that. It looks like their constant propagation logic doesn't work on loops at all, and it's just that their loop unroller stage (which runs before it) will unroll loops of less than 10 iterations.
- DannyBee 13y agoYes, which is kinda sad. both GCC and LLVM do it as a result of computing scalar evolutions for the variables, and then instantiating the final values after the loop. There are certain calculations both will bail on due to solving cost (rather than inability to solve), but otherwise ...