#include "llvm/Support/Compiler.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
+#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Utils/UnrollLoop.h"
#include <climits>
// Ignore instructions only used by the loop terminator.
} else if (isa<DbgInfoIntrinsic>(I)) {
// Ignore debug instructions
+ } else if (isa<GetElementPtrInst>(I) && I->hasOneUse()) {
+ // Ignore GEP as they generally are subsumed into a load or store.
} else if (isa<CallInst>(I)) {
// Estimate size overhead introduced by call instructions which
// is higher than other instructions. Here 3 and 10 are magic
LoopInfo *LI = &getAnalysis<LoopInfo>();
BasicBlock *Header = L->getHeader();
- DOUT << "Loop Unroll: F[" << Header->getParent()->getName()
- << "] Loop %" << Header->getName() << "\n";
+ DEBUG(errs() << "Loop Unroll: F[" << Header->getParent()->getName()
+ << "] Loop %" << Header->getName() << "\n");
+ (void)Header;
// Find trip count
unsigned TripCount = L->getSmallConstantTripCount();