Enhance GVN to do more precise alias queries for non-local memory

references. For example, this allows gvn to eliminate the load in
this example:

  void foo(int n, int* p, int *q) {
    p[0] = 0;
    p[1] = 1;
    if (n) {
      *q = p[0];
    }
  }


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118714 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman
2010-11-10 20:37:15 +00:00
parent af3d38f70e
commit 075fb5d68f
6 changed files with 129 additions and 27 deletions

View File

@@ -107,6 +107,12 @@ public:
return Copy;
}
Location getWithNewSize(uint64_t NewSize) const {
Location Copy(*this);
Copy.Size = NewSize;
return Copy;
}
Location getWithoutTBAATag() const {
Location Copy(*this);
Copy.TBAATag = 0;