forked from OSchip/llvm-project
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:
parent
a343a36713
commit
6d048a0d32
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue