From: Simon Pilgrim Date: Mon, 14 Sep 2020 12:24:17 +0000 (+0100) Subject: Assert we've found both vector types. NFCI. X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=98eaacd73d40eb28d5fa86bc3cfc9371581ee0cb;p=android-x86%2Fexternal-llvm-project.git Assert we've found both vector types. NFCI. Fixes clang static analyzer warning about potential null dereferences. --- diff --git a/llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp b/llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp index d8008320696..f36b3411570 100644 --- a/llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp +++ b/llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp @@ -1062,6 +1062,7 @@ static Value *CheckAndCreateOffsetAdd(Value *X, Value *Y, Value *GEP, FixSummands(YElType, X); XElType = cast(X->getType()); } + assert(XElType && YElType && "Unknown vector types"); // Check that the summands are of compatible types if (XElType != YElType) { LLVM_DEBUG(dbgs() << "masked gathers/scatters: incompatible gep offsets\n");