[PPC] PPCLoopPreIncPrep - silence static analyzer null dereference warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372430 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Simon Pilgrim 2019-09-20 21:27:49 +00:00
parent 2211abcace
commit a12910ca83

View File

@ -481,7 +481,7 @@ bool PPCLoopPreIncPrep::runOnLoop(Loop *L) {
if (PtrIP && isa<Instruction>(NewBasePtr) &&
cast<Instruction>(NewBasePtr)->getParent() == PtrIP->getParent())
PtrIP = nullptr;
else if (isa<PHINode>(PtrIP))
else if (PtrIP && isa<PHINode>(PtrIP))
PtrIP = &*PtrIP->getParent()->getFirstInsertionPt();
else if (!PtrIP)
PtrIP = I->Instr;