Skip to content

Commit

Permalink
[VPlan] Use isa<> instead getVPRecipeID in getFirstNonPhi (NFC).
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
fhahn committed Oct 30, 2020
1 parent b7c91a9 commit aa1a198
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions llvm/lib/Transforms/Vectorize/VPlan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<VPWidenPHIRecipe>(&*It) ||
isa<VPWidenIntOrFpInductionRecipe>(&*It) ||
isa<VPPredInstPHIRecipe>(&*It) ||
isa<VPWidenCanonicalIVRecipe>(&*It)))
It++;
return It;
}
Expand Down

0 comments on commit aa1a198

Please sign in to comment.