llvm-6502/lib
Arnold Schwaighofer 3d5f96ee1b 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163319 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-06 14:41:53 +00:00
..
Analysis BasicAA: Recognize cyclic NoAlias phis 2012-09-06 14:41:53 +00:00
Archive Mark checkSignature const, and in turn stop casting away const from 2012-09-05 22:09:23 +00:00
AsmParser [ms-inline asm] Enumerate the InlineAsm dialects and rename the nsdialect to 2012-09-05 19:00:49 +00:00
Bitcode [ms-inline asm] Enumerate the InlineAsm dialects and rename the nsdialect to 2012-09-05 19:00:49 +00:00
CodeGen Disable stack coloring by default in order to resolve the i386 failures. 2012-09-06 14:27:06 +00:00
DebugInfo Stop casting away const qualifier needlessly. 2012-09-05 22:26:57 +00:00
ExecutionEngine Stop casting away const qualifier needlessly. 2012-09-05 22:26:57 +00:00
Linker
MC Constify subtarget info properly so that we dont cast away the const in 2012-09-05 21:43:57 +00:00
Object
Support Whitespace. 2012-09-06 03:02:56 +00:00
TableGen
Target Use correct part of complex operand to encode VST1 alignment. 2012-09-06 14:36:55 +00:00
Transforms Fix switch_to_lookup_table.ll test from r163302. 2012-09-06 10:10:35 +00:00
VMCore Stop casting away const qualifier needlessly. 2012-09-05 22:26:57 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile