OSDN Git Service

Ignore debug intrinsics when computing dependences.
authorOwen Anderson <resistor@mac.com>
Mon, 9 Mar 2009 05:12:38 +0000 (05:12 +0000)
committerOwen Anderson <resistor@mac.com>
Mon, 9 Mar 2009 05:12:38 +0000 (05:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66399 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/MemoryDependenceAnalysis.cpp

index 6af365b..9ce7ca9 100644 (file)
@@ -18,6 +18,7 @@
 #include "llvm/Analysis/MemoryDependenceAnalysis.h"
 #include "llvm/Constants.h"
 #include "llvm/Instructions.h"
+#include "llvm/IntrinsicInst.h"
 #include "llvm/Function.h"
 #include "llvm/Analysis/AliasAnalysis.h"
 #include "llvm/ADT/Statistic.h"
@@ -121,6 +122,8 @@ getCallSiteDependencyFrom(CallSite CS, bool isReadOnlyCall,
       // FreeInsts erase the entire structure
       PointerSize = ~0ULL;
     } else if (isa<CallInst>(Inst) || isa<InvokeInst>(Inst)) {
+      // Debug intrinsics don't cause dependences.
+      if (isa<DbgInfoIntrinsic>(Inst)) break;
       CallSite InstCS = CallSite::get(Inst);
       // If these two calls do not interfere, look past it.
       switch (AA->getModRefInfo(CS, InstCS)) {
@@ -175,6 +178,9 @@ getPointerDependencyFrom(Value *MemPtr, uint64_t MemSize, bool isLoad,
   while (ScanIt != BB->begin()) {
     Instruction *Inst = --ScanIt;
 
+    // Debug intrinsics don't cause dependences.
+    if (isa<DbgInfoIntrinsic>(Inst)) continue;
+
     // Values depend on loads if the pointers are must aliased.  This means that
     // a load depends on another must aliased load from the same value.
     if (LoadInst *LI = dyn_cast<LoadInst>(Inst)) {