[PATCH] D20775: [CFLAA] Remove redundant aliasing relation between GEP indices and GEP result

Jia Chen via llvm-commits llvm-commits at lists.llvm.org
Sat May 28 13:20:15 PDT 2016


grievejia created this revision.
grievejia added reviewers: hfinkel, george.burgess.iv.
grievejia added a subscriber: llvm-commits.

As shown in the diff, if cfl-aa encounters a GEP instructions y = gep x, z, we used to treat y and z as potential aliases. However, according to the "Pointer Aliasing Rule" section of LLVM Language Reference, this decision turns out to be overly defensive.

http://reviews.llvm.org/D20775

Files:
  lib/Analysis/CFLAliasAnalysis.cpp

Index: lib/Analysis/CFLAliasAnalysis.cpp
===================================================================
--- lib/Analysis/CFLAliasAnalysis.cpp
+++ lib/Analysis/CFLAliasAnalysis.cpp
@@ -209,8 +209,6 @@
   void visitGetElementPtrInst(GetElementPtrInst &Inst) {
     auto *Op = Inst.getPointerOperand();
     Output.push_back(Edge(&Inst, Op, EdgeType::Assign, AttrNone));
-    for (auto I = Inst.idx_begin(), E = Inst.idx_end(); I != E; ++I)
-      Output.push_back(Edge(&Inst, *I, EdgeType::Assign, AttrNone));
   }
 
   void visitSelectInst(SelectInst &Inst) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20775.58902.patch
Type: text/x-patch
Size: 564 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160528/07cf229e/attachment.bin>


More information about the llvm-commits mailing list