[PATCH] D15825: [MDA] Don't be quite as conservative for noalias functions

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 4 16:52:50 PST 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL256802: [MDA] Don't be quite as conservative for noalias functions (authored by reames).

Changed prior to commit:
  http://reviews.llvm.org/D15825?vs=43790&id=43946#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D15825

Files:
  llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp

Index: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp
===================================================================
--- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp
+++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp
@@ -685,13 +685,13 @@
         return MemDepResult::getDef(Inst);
       if (isInvariantLoad)
         continue;
-      // Be conservative if the accessed pointer may alias the allocation.
-      if (AA->alias(Inst, AccessPtr) != NoAlias)
-        return MemDepResult::getClobber(Inst);
-      // If the allocation is not aliased and does not read memory (like
-      // strdup), it is safe to ignore.
-      if (isa<AllocaInst>(Inst) ||
-          isMallocLikeFn(Inst, TLI) || isCallocLikeFn(Inst, TLI))
+      // Be conservative if the accessed pointer may alias the allocation -
+      // fallback to the generic handling below.
+      if ((AA->alias(Inst, AccessPtr) == NoAlias) &&
+          // If the allocation is not aliased and does not read memory (like
+          // strdup), it is safe to ignore.
+          (isa<AllocaInst>(Inst) || isMallocLikeFn(Inst, TLI) ||
+           isCallocLikeFn(Inst, TLI)))
         continue;
     }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15825.43946.patch
Type: text/x-patch
Size: 1185 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160105/b35654ca/attachment.bin>


More information about the llvm-commits mailing list