forked from OSchip/llvm-project
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:
parent
369d16a1c6
commit
e2ded3d131
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue