Skip debug info intrinsics.
authorDevang Patel <dpatel@apple.com>
Mon, 15 Mar 2010 22:23:03 +0000 (22:23 +0000)
committerDevang Patel <dpatel@apple.com>
Mon, 15 Mar 2010 22:23:03 +0000 (22:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98584 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/IndVarSimplify.cpp

index 838a3e74875cd9d69f3f696aab2c428126772fa5..de93e9f621fe38a745ef74db4f0202258a890ec2 100644 (file)
@@ -43,6 +43,7 @@
 #include "llvm/BasicBlock.h"
 #include "llvm/Constants.h"
 #include "llvm/Instructions.h"
+#include "llvm/IntrinsicInst.h"
 #include "llvm/LLVMContext.h"
 #include "llvm/Type.h"
 #include "llvm/Analysis/Dominators.h"
@@ -556,6 +557,9 @@ void IndVarSimplify::SinkUnusedInvariants(Loop *L) {
     // dominates the exit block.
     if (I->mayHaveSideEffects() || I->mayReadFromMemory())
       continue;
+    // Skip debug info intrinsics.
+    if (isa<DbgInfoIntrinsic>(I))
+      continue;
     // Don't sink static AllocaInsts out of the entry block, which would
     // turn them into dynamic allocas!
     if (AllocaInst *AI = dyn_cast<AllocaInst>(I))