//
//===----------------------------------------------------------------------===//
-#include "llvm/Transforms/Scalar/DecomposeMultiDimRefs.h"
+#include "llvm/Transforms/Scalar.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Constant.h"
#include "llvm/iMemory.h"
#include "llvm/iOther.h"
#include "llvm/BasicBlock.h"
#include "llvm/Pass.h"
+#include "Support/StatisticReporter.h"
+
+static Statistic<> NumAdded("lowerrefs\t\t- New instructions added");
namespace {
struct DecomposePass : public BasicBlockPass {
if (!indexIsZero) {
LastPtr = new GetElementPtrInst(LastPtr, Indices, "ptr1");
NewInsts.push_back(cast<Instruction>(LastPtr));
+ ++NumAdded;
}
// Instruction 2: nextPtr2 = cast nextPtr1 to NextPtrTy
if (LastPtr->getType() != NextPtrTy) {
LastPtr = new CastInst(LastPtr, NextPtrTy, "ptr2");
NewInsts.push_back(cast<Instruction>(LastPtr));
+ ++NumAdded;
}
}