Displaying 1 result from an estimated 1 matches for "dont_optimize_away".
2012 Dec 28
1
[LLVMdev] Surprising SCEV / Constant folding result
Hello,
I've tested LLVM's ScalarEvolution analysis with different small examples.
Here's a result that surprised me:
void dont_optimize_away(int);
void foo(int n) {
int res = 0;
for (int i = 0; i < n; ++i) {
// The kind of things that SCEV can recognize is quite astounding...
// It wins over gcc for this one.
//res = res + i*i;
// Also, the kind of things it can't recognize...
res = res * i;
}
dont_o...