#include "llvm/Pass.h"
#include "llvm/Function.h"
#include "llvm/BasicBlock.h"
-#include "llvm/ConstantVals.h"
+#include "llvm/Constant.h"
using std::vector;
using std::map;
map<BasicBlock*,vector<PHINode*> > NewPhiNodes; // the PhiNodes we're adding
public:
+ const char *getPassName() const { return "Promote Memory to Register"; }
+
// runOnFunction - To run this pass, first we calculate the alloca
// instructions that are safe for promotion, then we promote each one.
//
//
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired(DominanceFrontier::ID);
+ AU.preservesCFG();
}
private:
if (MAI->hasIndices()) { // indexed?
// Allow the access if there is only one index and the index is
// zero.
- if (*MAI->idx_begin() != ConstantUInt::get(Type::UIntTy, 0) ||
+ if (*MAI->idx_begin() != Constant::getNullValue(Type::UIntTy) ||
MAI->idx_begin()+1 != MAI->idx_end())
return false;
}