aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorArnold Schwaighofer <arnolds@codeaurora.org>2012-09-06 14:41:53 +0000
committerArnold Schwaighofer <arnolds@codeaurora.org>2012-09-06 14:41:53 +0000
commit8dc34cfb9988732927ff19c8376e3b736f57b73c (patch)
tree3a0aaeb0f4e061e8e26bec063d5571be1c44d908 /clang/lib/CodeGen/CodeGenModule.cpp
parent262f6f564f29ef6cf0f7ab1d557dcb627820cd79 (diff)
downloadllvm-8dc34cfb9988732927ff19c8376e3b736f57b73c.zip
llvm-8dc34cfb9988732927ff19c8376e3b736f57b73c.tar.gz
llvm-8dc34cfb9988732927ff19c8376e3b736f57b73c.tar.bz2
BasicAA: Recognize cyclic NoAlias phis
Enhances basic alias analysis to recognize phis whose first incoming values are NoAlias and whose other incoming values are just the phi node itself through some amount of recursion. Example: With this change basicaa reports that ptr_phi and ptr_phi2 do not alias each other. bb: ptr = ptr2 + 1 loop: ptr_phi = phi [bb, ptr], [loop, ptr_plus_one] ptr2_phi = phi [bb, ptr2], [loop, ptr2_plus_one] ... ptr_plus_one = gep ptr_phi, 1 ptr2_plus_one = gep ptr2_phi, 1 This enables the elimination of one load in code like the following: extern int foo; int test_noalias(int *ptr, int num, int* coeff) { int *ptr2 = ptr; int result = (*ptr++) * (*coeff--); while (num--) { *ptr2++ = *ptr; result += (*coeff--) * (*ptr++); } *ptr = foo; return result; } Part 2/2 of fix for PR13564. llvm-svn: 163319
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions