From 98eaacd73d40eb28d5fa86bc3cfc9371581ee0cb Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Mon, 14 Sep 2020 13:24:17 +0100 Subject: [PATCH] Assert we've found both vector types. NFCI. Fixes clang static analyzer warning about potential null dereferences. --- llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp | 1 + 1 file changed, 1 insertion(+) 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"); -- 2.11.0