LoopAccessAnalysis isConsecutiveAccess() - silence static analyzer dyn_cast<SCEVConstant> null dereference warning. NFCI.

The static analyzer is warning about potential null dereferences, but in these cases we should be able to use cast<SCEVConstant> directly and if not assert will fire for us.

llvm-svn: 373465
This commit is contained in:
Simon Pilgrim 2019-10-02 13:08:56 +00:00
parent 369d16a1c6
commit e2ded3d131
1 changed files with 2 additions and 2 deletions

View File

@ -1212,8 +1212,8 @@ bool llvm::isConsecutiveAccess(Value *A, Value *B, const DataLayout &DL,
const SCEV *OffsetSCEVA = SE.getConstant(OffsetA);
const SCEV *OffsetSCEVB = SE.getConstant(OffsetB);
const SCEV *OffsetDeltaSCEV = SE.getMinusSCEV(OffsetSCEVB, OffsetSCEVA);
const SCEVConstant *OffsetDeltaC = dyn_cast<SCEVConstant>(OffsetDeltaSCEV);
const APInt &OffsetDelta = OffsetDeltaC->getAPInt();
const APInt &OffsetDelta = cast<SCEVConstant>(OffsetDeltaSCEV)->getAPInt();
// Check if they are based on the same pointer. That makes the offsets
// sufficient.
if (PtrA == PtrB)