4 ms·
When you say "eliminate the loop", do you mean loop unrolling? They are compiling with -O2, I'm not sure if that does loop unrolling. If it does, how much unro
by p1esk 10y ago
When you say "eliminate the loop", do you mean loop unrolling?
They are compiling with -O2, I'm not sure if that does loop unrolling. If it does, how much unrolling does it do, exactly? I can't imagine it would construct a block of code with a billion add instructions.
- corndoge 10y agos += NUMBER or s = NUMBER
- danellis 10y agoEliminating the loop means the compiler looks at the code and says "the value computed in this loop is never actually used, so might as well just get rid of that code altogether".
- DannyBee 10y agoFirst, it's unused, so it'll just kill it. If it wasn't, most compilers can compute sum reductions, etc, pretty well. Anything that is easily expressed as a set of simple recurrences that can be solved, it'll solve.