From 64613ea8c8fa4bbccdfb2666bcdb27ba635fd5a2 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! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18108 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/LoopUnroll.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Transforms/Scalar/LoopUnroll.cpp b/lib/Transforms/Scalar/LoopUnroll.cpp index f87b2cae933..1b807873e6a 100644 --- a/lib/Transforms/Scalar/LoopUnroll.cpp +++ b/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; }