From 4736e57199fabdf72888c39854b8bb9cfdbf1cb7 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 25 Feb 2022 12:07:49 +0100 Subject: [PATCH] [IndVars] Use phis() (NFC) --- llvm/lib/Transforms/Scalar/IndVarSimplify.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 -- 2.7.4