From: Nikita Popov Date: Sun, 29 Aug 2021 18:46:24 +0000 (+0200) Subject: [SCEVExpander] Remove unnecessary mul/udiv check (NFC) X-Git-Tag: upstream/15.0.7~32772 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0886fd5b3a374525c382145deee7049ec1d0fe91;p=platform%2Fupstream%2Fllvm.git [SCEVExpander] Remove unnecessary mul/udiv check (NFC) Pointer-typed SCEV expressions can no longer be mul or udiv, so we do not need to specially handle them here. --- diff --git a/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp b/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp index e0205c1..5d3d98a 100644 --- a/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp +++ b/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp @@ -1581,14 +1581,9 @@ Value *SCEVExpander::visitAddRecExpr(const SCEVAddRecExpr *S) { ExposePointerBase(Base, ExposedRest, SE); // If we found a pointer, expand the AddRec with a GEP. if (PointerType *PTy = dyn_cast(Base->getType())) { - // Make sure the Base isn't something exotic, such as a multiplied - // or divided pointer value. In those cases, the result type isn't - // actually a pointer type. - if (!isa(Base) && !isa(Base)) { - Value *StartV = expand(Base); - assert(StartV->getType() == PTy && "Pointer type mismatch for GEP!"); - return expandAddToGEP(ExposedRest, PTy, Ty, StartV); - } + Value *StartV = expand(Base); + assert(StartV->getType() == PTy && "Pointer type mismatch for GEP!"); + return expandAddToGEP(ExposedRest, PTy, Ty, StartV); } // Just do a normal add. Pre-expand the operands to suppress folding.