Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ bool VPlanVerifier::verifyPhiRecipes(const VPBasicBlock *VPBB) {
NumActiveLaneMaskPhiRecipes++;

if (IsHeaderVPBB && !isa<VPHeaderPHIRecipe, VPWidenPHIRecipe>(*RecipeI) &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (IsHeaderVPBB && !isa<VPHeaderPHIRecipe, VPWidenPHIRecipe>(*RecipeI) &&
if (IsHeaderVPBB && !isa<VPHeaderPHIRecipe, VPWidenPHIRecipe, VPPhi>(*RecipeI) &&

This can just use VPPhi I think.

!isa<VPInstruction>(*RecipeI) &&
cast<VPInstruction>(RecipeI)->getOpcode() == Instruction::PHI) {
!(isa<VPInstruction>(*RecipeI) &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the definition of isPhi it seems like we're missing tests where we have a VPPredInstPHIRecipe in the header VPBB, since that seems to be the only one (besides VPInstructions) where isPhi would return true and isa<VPHeaderPHIRecipe, VPWidenPHIRecipe>(*RecipeI) would return false.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But looking at VPPredInstPHIRecipe it seems unlikely to be in the header, right? So perhaps there is no way to write a test case that proves this was broken.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a VPIRPhi, i.e a VPIRInstruction with a PHI opcode should also be caught by this, I've added a test case for it in c170996

cast<VPInstruction>(RecipeI)->getOpcode() == Instruction::PHI)) {
errs() << "Found non-header PHI recipe in header VPBB";
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
errs() << ": ";
Expand Down