From 6d048a0d32e8c527b46312a6da8cbc9496025984 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 22 Nov 2004 17:18:36 +0000 Subject: [PATCH] Do not consider debug intrinsics in the size computations for loop unrolling. Patch contributed by Michael McCracken! llvm-svn: 18108 --- llvm/lib/Transforms/Scalar/LoopUnroll.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/llvm/lib/Transforms/Scalar/LoopUnroll.cpp b/llvm/lib/Transforms/Scalar/LoopUnroll.cpp index f87b2cae9331..1b807873e6a4 100644 --- a/llvm/lib/Transforms/Scalar/LoopUnroll.cpp +++ b/llvm/lib/Transforms/Scalar/LoopUnroll.cpp @@ -28,6 +28,7 @@ #include "llvm/Support/Debug.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/STLExtras.h" +#include "llvm/IntrinsicInst.h" #include #include #include @@ -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(I)) { + // Ignore debug instructions } else { ++Size; }