forked from OSchip/llvm-project
parent
bdbe6130f4
commit
6acc782dad
|
@ -808,10 +808,10 @@ Value *GVN::GetValueForBlock(BasicBlock *BB, LoadInst* orig,
|
|||
DenseMap<BasicBlock*, Value*>::iterator V = Phis.find(BB);
|
||||
if (V != Phis.end() && !top_level) return V->second;
|
||||
|
||||
if (!getAnalysis<DominatorTree>().isReachableFromEntry(BB)) {
|
||||
Phis[BB] = UndefValue::get(orig->getType());
|
||||
return UndefValue::get(orig->getType());
|
||||
}
|
||||
// If the block is unreachable, just return undef, since this path
|
||||
// can't actually occur at runtime.
|
||||
if (!getAnalysis<DominatorTree>().isReachableFromEntry(BB))
|
||||
return Phis[BB] = UndefValue::get(orig->getType());
|
||||
|
||||
BasicBlock* singlePred = BB->getSinglePredecessor();
|
||||
if (singlePred) {
|
||||
|
|
Loading…
Reference in New Issue