diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2011-10-24 06:57:05 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2011-10-24 06:57:05 +0000 |
commit | 9be7f277e4d4461188fa38895981b89fb880c845 (patch) | |
tree | 465c8a11a58539225a657e82a9f926f1b589c534 /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | f5394bcf5e8bc0a43862050d314b164c534076d2 (diff) | |
download | bcm5719-llvm-9be7f277e4d4461188fa38895981b89fb880c845.tar.gz bcm5719-llvm-9be7f277e4d4461188fa38895981b89fb880c845.zip |
Reapply r142781 with fix. Original message:
Enhance SCEV's brute force loop analysis to handle multiple PHI nodes in the
loop header when computing the trip count.
With this, we now constant evaluate:
struct ListNode { const struct ListNode *next; int i; };
static const struct ListNode node1 = {0, 1};
static const struct ListNode node2 = {&node1, 2};
static const struct ListNode node3 = {&node2, 3};
int test() {
int sum = 0;
for (const struct ListNode *n = &node3; n != 0; n = n->next)
sum += n->i;
return sum;
}
llvm-svn: 142790
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
0 files changed, 0 insertions, 0 deletions