From: Nikita Popov Date: Fri, 25 Feb 2022 11:07:49 +0000 (+0100) Subject: [IndVars] Use phis() (NFC) X-Git-Tag: upstream/15.0.7~15301 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4736e57199fabdf72888c39854b8bb9cfdbf1cb7;p=platform%2Fupstream%2Fllvm.git [IndVars] Use phis() (NFC) --- diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp index ceb03eb..552ea1a 100644 --- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -605,10 +605,10 @@ bool IndVarSimplify::simplifyAndExtend(Loop *L, Intrinsic::getName(Intrinsic::experimental_guard)); bool HasGuards = GuardDecl && !GuardDecl->use_empty(); - SmallVector LoopPhis; - for (BasicBlock::iterator I = L->getHeader()->begin(); isa(I); ++I) { - LoopPhis.push_back(cast(I)); - } + SmallVector LoopPhis; + for (PHINode &PN : L->getHeader()->phis()) + LoopPhis.push_back(&PN); + // Each round of simplification iterates through the SimplifyIVUsers worklist // for all current phis, then determines whether any IVs can be // widened. Widening adds new phis to LoopPhis, inducing another round of