From 462664777cf7ec813e44dc0e624b69153269dc4b Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Mon, 23 Sep 2019 15:36:24 +0000 Subject: [PATCH] HexagonLoopIdiomRecognition - silence static analyzer dyn_cast<> null dereference warnings. NFCI. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372619 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp b/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp index 18be03332f8..bda3eccac0c 100644 --- a/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp +++ b/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp @@ -632,9 +632,9 @@ Value *PolynomialMultiplyRecognize::getCountIV(BasicBlock *BB) { if (!isa(InitV) || !cast(InitV)->isZero()) continue; Value *IterV = PN->getIncomingValueForBlock(BB); - if (!isa(IterV)) - continue; auto *BO = dyn_cast(IterV); + if (!BO) + continue; if (BO->getOpcode() != Instruction::Add) continue; Value *IncV = nullptr; @@ -2020,7 +2020,7 @@ bool HexagonLoopIdiomRecognize::processCopyingStore(Loop *CurLoop, // See if the pointer expression is an AddRec like {base,+,1} on the current // loop, which indicates a strided load. If we have something else, it's a // random load we can't handle. - LoadInst *LI = dyn_cast(SI->getValueOperand()); + auto *LI = cast(SI->getValueOperand()); auto *LoadEv = cast(SE->getSCEV(LI->getPointerOperand())); // The trip count of the loop and the base pointer of the addrec SCEV is -- 2.50.1