Do not consider debug intrinsics in the size computations for loop unrolling.

Patch contributed by Michael McCracken!

llvm-svn: 18108
This commit is contained in:
Chris Lattner 2004-11-22 17:18:36 +00:00
parent a343a36713
commit 6d048a0d32
1 changed files with 3 additions and 0 deletions

View 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;
}