From aa1a198a6405aeb1321fb3209bee787dc3415197 Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Fri, 30 Oct 2020 14:45:08 +0000 Subject: [PATCH] [VPlan] Use isa<> instead getVPRecipeID in getFirstNonPhi (NFC). As per the comment in VPRecipeBase, clients should not rely on getVPRecipeID, as it may change in the future. It should only be used in classof implementations. Use isa instead in getFirstNonPhi. --- llvm/lib/Transforms/Vectorize/VPlan.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/llvm/lib/Transforms/Vectorize/VPlan.cpp b/llvm/lib/Transforms/Vectorize/VPlan.cpp index 5287c37..95f9b14 100644 --- a/llvm/lib/Transforms/Vectorize/VPlan.cpp +++ b/llvm/lib/Transforms/Vectorize/VPlan.cpp @@ -213,11 +213,10 @@ void VPBlockBase::deleteCFG(VPBlockBase *Entry) { VPBasicBlock::iterator VPBasicBlock::getFirstNonPhi() { iterator It = begin(); - while (It != end() && - (It->getVPRecipeID() == VPRecipeBase::VPWidenPHISC || - It->getVPRecipeID() == VPRecipeBase::VPWidenIntOrFpInductionSC || - It->getVPRecipeID() == VPRecipeBase::VPPredInstPHISC || - It->getVPRecipeID() == VPRecipeBase::VPWidenCanonicalIVSC)) + while (It != end() && (isa(&*It) || + isa(&*It) || + isa(&*It) || + isa(&*It))) It++; return It; } -- 2.7.4