[VPlan] Use isa<> instead getVPRecipeID in getFirstNonPhi (NFC).
authorFlorian Hahn <flo@fhahn.com>
Fri, 30 Oct 2020 14:45:08 +0000 (14:45 +0000)
committerFlorian Hahn <flo@fhahn.com>
Fri, 30 Oct 2020 14:56:06 +0000 (14:56 +0000)
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

index 5287c37..95f9b14 100644 (file)
@@ -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;
 }