summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/IdentifierTable.cpp
diff options
context:
space:
mode:
authorDavid Peixotto <dpeixott@codeaurora.org>2014-01-03 17:20:01 +0000
committerDavid Peixotto <dpeixott@codeaurora.org>2014-01-03 17:20:01 +0000
commitea9ba446d51626ed6b47814828098d32c31fcae7 (patch)
tree8b28874f868d8888d23c6597ffba5b63d3394a39 /clang/lib/Basic/IdentifierTable.cpp
parent2cfbc00506734a4b67cdc5c9549344fb7659c4d6 (diff)
downloadbcm5719-llvm-ea9ba446d51626ed6b47814828098d32c31fcae7.tar.gz
bcm5719-llvm-ea9ba446d51626ed6b47814828098d32c31fcae7.zip
Fix loop rerolling pass failure with non-consant loop lower bound
The loop rerolling pass was failing with an assertion failure from a failed cast on loops like this: void foo(int *A, int *B, int m, int n) { for (int i = m; i < n; i+=4) { A[i+0] = B[i+0] * 4; A[i+1] = B[i+1] * 4; A[i+2] = B[i+2] * 4; A[i+3] = B[i+3] * 4; } } The code was casting the SCEV-expanded code for the new induction variable to a phi-node. When the loop had a non-constant lower bound, the SCEV expander would end the code expansion with an add insted of a phi node and the cast would fail. It looks like the cast to a phi node was only needed to get the induction variable value coming from the backedge to compute the end of loop condition. This patch changes the loop reroller to compare the induction variable to the number of times the backedge is taken instead of the iteration count of the loop. In other words, we stop the loop when the current value of the induction variable == IterationCount-1. Previously, the comparison was comparing the induction variable value from the next iteration == IterationCount. This problem only seems to occur on 32-bit targets. For some reason, the loop is not rerolled on 64-bit targets. PR18290 llvm-svn: 198425
Diffstat (limited to 'clang/lib/Basic/IdentifierTable.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud