Skip to content

Commit 59978d0

Browse files
Removed evl verification
1 parent 75bf9f8 commit 59978d0

File tree

1 file changed

+0
-71
lines changed

1 file changed

+0
-71
lines changed

llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp

Lines changed: 0 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include "VPlanDominatorTree.h"
1919
#include "llvm/ADT/DepthFirstIterator.h"
2020
#include "llvm/ADT/SmallPtrSet.h"
21-
#include "llvm/ADT/TypeSwitch.h"
2221
#include "llvm/Support/CommandLine.h"
2322

2423
#define DEBUG_TYPE "loop-vectorize"
@@ -36,11 +35,6 @@ class VPlanVerifier {
3635
// VPHeaderPHIRecipes.
3736
bool verifyPhiRecipes(const VPBasicBlock *VPBB);
3837

39-
// Verify that \p EVL is used correctly. The user must be either in EVL-based
40-
// recipes as a last operand or VPInstruction::Add which is incoming value
41-
// into EVL's recipe.
42-
bool verifyEVLRecipe(const VPInstruction &EVL) const;
43-
4438
bool verifyVPBasicBlock(const VPBasicBlock *VPBB);
4539

4640
bool verifyBlock(const VPBlockBase *VPB);
@@ -120,64 +114,6 @@ bool VPlanVerifier::verifyPhiRecipes(const VPBasicBlock *VPBB) {
120114
return true;
121115
}
122116

123-
bool VPlanVerifier::verifyEVLRecipe(const VPInstruction &EVL) const {
124-
if (EVL.getOpcode() != VPInstruction::ExplicitVectorLength) {
125-
errs() << "verifyEVLRecipe should only be called on "
126-
"VPInstruction::ExplicitVectorLength\n";
127-
return false;
128-
}
129-
auto VerifyEVLUse = [&](const VPRecipeBase &R,
130-
const unsigned ExpectedIdx) -> bool {
131-
SmallVector<const VPValue *> Ops(R.operands());
132-
unsigned UseCount = count(Ops, &EVL);
133-
if (UseCount != 1 || Ops[ExpectedIdx] != &EVL) {
134-
errs() << "EVL is used as non-last operand in EVL-based recipe\n";
135-
return false;
136-
}
137-
return true;
138-
};
139-
for (const VPUser *U : EVL.users()) {
140-
if (!TypeSwitch<const VPUser *, bool>(U)
141-
.Case<VPWidenStoreEVLRecipe>([&](const VPWidenStoreEVLRecipe *S) {
142-
return VerifyEVLUse(*S, 2);
143-
})
144-
.Case<VPWidenLoadEVLRecipe>([&](const VPWidenLoadEVLRecipe *L) {
145-
return VerifyEVLUse(*L, 1);
146-
})
147-
.Case<VPWidenEVLRecipe>([&](const VPWidenEVLRecipe *W) {
148-
return VerifyEVLUse(
149-
*W, Instruction::isUnaryOp(W->getOpcode()) ? 1 : 2);
150-
})
151-
.Case<VPScalarCastRecipe>(
152-
[&](const VPScalarCastRecipe *S) { return true; })
153-
.Case<VPInstruction>([&](const VPInstruction *I) {
154-
if (I->getOpcode() != Instruction::Add) {
155-
errs()
156-
<< "EVL is used as an operand in non-VPInstruction::Add\n";
157-
return false;
158-
}
159-
if (I->getNumUsers() != 1) {
160-
errs() << "EVL is used in VPInstruction:Add with multiple "
161-
"users\n";
162-
return false;
163-
}
164-
if (!isa<VPEVLBasedIVPHIRecipe>(*I->users().begin())) {
165-
errs() << "Result of VPInstruction::Add with EVL operand is "
166-
"not used by VPEVLBasedIVPHIRecipe\n";
167-
return false;
168-
}
169-
return true;
170-
})
171-
.Default([&](const VPUser *U) {
172-
errs() << "EVL has unexpected user\n";
173-
return false;
174-
})) {
175-
return false;
176-
}
177-
}
178-
return true;
179-
}
180-
181117
bool VPlanVerifier::verifyVPBasicBlock(const VPBasicBlock *VPBB) {
182118
if (!verifyPhiRecipes(VPBB))
183119
return false;
@@ -214,13 +150,6 @@ bool VPlanVerifier::verifyVPBasicBlock(const VPBasicBlock *VPBB) {
214150
}
215151
}
216152
}
217-
if (const auto *EVL = dyn_cast<VPInstruction>(&R)) {
218-
if (EVL->getOpcode() == VPInstruction::ExplicitVectorLength &&
219-
!verifyEVLRecipe(*EVL)) {
220-
errs() << "EVL VPValue is not used correctly\n";
221-
return false;
222-
}
223-
}
224153
}
225154

226155
auto *IRBB = dyn_cast<VPIRBasicBlock>(VPBB);

0 commit comments

Comments
 (0)