Do not consider debug intrinsics in the size computations for loop unrolling.
authorChris Lattner <sabre@nondot.org>
Mon, 22 Nov 2004 17:18:36 +0000 (17:18 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 22 Nov 2004 17:18:36 +0000 (17:18 +0000)
Patch contributed by Michael McCracken!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18108 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/LoopUnroll.cpp

index f87b2cae93310f2157b3bf5a1654303e8f206008..1b807873e6a4e35a1c9032ecb487533834b184f7 100644 (file)
@@ -28,6 +28,7 @@
 #include "llvm/Support/Debug.h"
 #include "llvm/ADT/Statistic.h"
 #include "llvm/ADT/STLExtras.h"
+#include "llvm/IntrinsicInst.h"
 #include <cstdio>
 #include <set>
 #include <algorithm>
@@ -86,6 +87,8 @@ static unsigned ApproximateLoopSize(const Loop *L) {
         // Ignore PHI nodes in the header.
       } else if (I->hasOneUse() && I->use_back() == Term) {
         // Ignore instructions only used by the loop terminator.
+      } else if (DbgInfoIntrinsic *DbgI = dyn_cast<DbgInfoIntrinsic>(I)) {
+       // Ignore debug instructions 
       } else {
         ++Size;
       }