Move more code back to 2.5 APIs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77635 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Owen Anderson
2009-07-30 23:03:37 +00:00
parent 124e6eb09d
commit 9e9a0d5fc2
47 changed files with 188 additions and 236 deletions

View File

@ -798,7 +798,7 @@ Value *GVN::GetValueForBlock(BasicBlock *BB, Instruction* orig,
// If the block is unreachable, just return undef, since this path
// can't actually occur at runtime.
if (!DT->isReachableFromEntry(BB))
return Phis[BB] = BB->getContext().getUndef(orig->getType());
return Phis[BB] = UndefValue::get(orig->getType());
if (BasicBlock *Pred = BB->getSinglePredecessor()) {
Value *ret = GetValueForBlock(Pred, orig, Phis);
@ -985,8 +985,8 @@ bool GVN::processNonLocalLoad(LoadInst *LI,
// Loading the allocation -> undef.
if (isa<AllocationInst>(DepInst)) {
ValuesPerBlock.push_back(std::make_pair(DepBB,
DepBB->getContext().getUndef(LI->getType())));
ValuesPerBlock.push_back(std::make_pair(DepBB,
UndefValue::get(LI->getType())));
continue;
}
@ -1273,7 +1273,7 @@ bool GVN::processLoad(LoadInst *L, SmallVectorImpl<Instruction*> &toErase) {
// undef value. This can happen when loading for a fresh allocation with no
// intervening stores, for example.
if (isa<AllocationInst>(DepInst)) {
L->replaceAllUsesWith(DepInst->getContext().getUndef(L->getType()));
L->replaceAllUsesWith(UndefValue::get(L->getType()));
toErase.push_back(L);
NumGVNLoad++;
return true;