aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-11-22 17:18:36 +0000
committerChris Lattner <sabre@nondot.org>2004-11-22 17:18:36 +0000
commit64613ea8c8fa4bbccdfb2666bcdb27ba635fd5a2 (patch)
treee6d5c28d8f0a2a1d3200885c0482f39962f30a62 /lib
parent3e775143fb562cddc27734ba46a3ccf3aa0f3e01 (diff)
downloadexternal_llvm-64613ea8c8fa4bbccdfb2666bcdb27ba635fd5a2.zip
external_llvm-64613ea8c8fa4bbccdfb2666bcdb27ba635fd5a2.tar.gz
external_llvm-64613ea8c8fa4bbccdfb2666bcdb27ba635fd5a2.tar.bz2
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
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/Scalar/LoopUnroll.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/LoopUnroll.cpp b/lib/Transforms/Scalar/LoopUnroll.cpp
index f87b2ca..1b80787 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 <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;
}