Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 1 addition & 2 deletions llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7508,8 +7508,7 @@ DenseMap<const SCEV *, Value *> LoopVectorizationPlanner::executePlan(
State.CFG.PrevBB->getSingleSuccessor(), &BestVPlan);
VPlanTransforms::removeDeadRecipes(BestVPlan);

assert(verifyVPlanIsValid(BestVPlan, true /*VerifyLate*/) &&
"final VPlan is invalid");
assert(verifyVPlanIsValid(BestVPlan) && "final VPlan is invalid");

// After vectorization, the exit blocks of the original loop will have
// additional predecessors. Invalidate SCEVs for the exit phis in case SE
Expand Down
12 changes: 5 additions & 7 deletions llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ namespace {
class VPlanVerifier {
const VPDominatorTree &VPDT;
VPTypeAnalysis &TypeInfo;
bool VerifyLate;

SmallPtrSet<BasicBlock *, 8> WrappedIRBBs;

Expand Down Expand Up @@ -62,9 +61,8 @@ class VPlanVerifier {
bool verifyRegionRec(const VPRegionBlock *Region);

public:
VPlanVerifier(VPDominatorTree &VPDT, VPTypeAnalysis &TypeInfo,
bool VerifyLate)
: VPDT(VPDT), TypeInfo(TypeInfo), VerifyLate(VerifyLate) {}
VPlanVerifier(VPDominatorTree &VPDT, VPTypeAnalysis &TypeInfo)
: VPDT(VPDT), TypeInfo(TypeInfo) {}

bool verify(const VPlan &Plan);
};
Expand Down Expand Up @@ -119,7 +117,7 @@ bool VPlanVerifier::verifyPhiRecipes(const VPBasicBlock *VPBB) {
RecipeI++;
}

if (!VerifyLate && NumActiveLaneMaskPhiRecipes > 1) {
if (!VPBB->getPlan()->isUnrolled() && NumActiveLaneMaskPhiRecipes > 1) {
errs() << "There should be no more than one VPActiveLaneMaskPHIRecipe";
return false;
}
Expand Down Expand Up @@ -456,9 +454,9 @@ bool VPlanVerifier::verify(const VPlan &Plan) {
return true;
}

bool llvm::verifyVPlanIsValid(const VPlan &Plan, bool VerifyLate) {
bool llvm::verifyVPlanIsValid(const VPlan &Plan) {
VPDominatorTree VPDT(const_cast<VPlan &>(Plan));
VPTypeAnalysis TypeInfo(Plan);
VPlanVerifier Verifier(VPDT, TypeInfo, VerifyLate);
VPlanVerifier Verifier(VPDT, TypeInfo);
return Verifier.verify(Plan);
}
7 changes: 2 additions & 5 deletions llvm/lib/Transforms/Vectorize/VPlanVerifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,13 @@
namespace llvm {
class VPlan;

/// Verify invariants for general VPlans. If \p VerifyLate is passed, skip some
/// checks that are not applicable at later stages of the transform pipeline.
/// Currently it checks the following:
/// Verify invariants for general VPlans. Currently it checks the following:
/// 1. Region/Block verification: Check the Region/Block verification
/// invariants for every region in the H-CFG.
/// 2. all phi-like recipes must be at the beginning of a block, with no other
/// recipes in between. Note that currently there is still an exception for
/// VPBlendRecipes.
LLVM_ABI_FOR_TEST bool verifyVPlanIsValid(const VPlan &Plan,
bool VerifyLate = false);
LLVM_ABI_FOR_TEST bool verifyVPlanIsValid(const VPlan &Plan);

} // namespace llvm

Expand Down