Skip to content

Commit 8780630

Browse files
committed
[RISCV] Merge two similar asserts from different if/else blocks. NFC
1 parent cf71f97 commit 8780630

File tree

1 file changed

+11
-20
lines changed

1 file changed

+11
-20
lines changed

llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2383,27 +2383,18 @@ bool RISCVDAGToDAGISel::doPeepholeMaskedRVV(SDNode *N) {
23832383
}
23842384
}
23852385

2386-
if (IsTA) {
2387-
uint64_t TSFlags = TII.get(I->UnmaskedPseudo).TSFlags;
2388-
2389-
// Check that we're dropping the merge operand, the mask operand, and any
2390-
// policy operand when we transform to this unmasked pseudo.
2391-
assert(!RISCVII::hasMergeOp(TSFlags) && RISCVII::hasDummyMaskOp(TSFlags) &&
2392-
!RISCVII::hasVecPolicyOp(TSFlags) &&
2393-
"Unexpected pseudo to transform to");
2394-
(void)TSFlags;
2395-
} else {
2396-
uint64_t TSFlags = TII.get(I->UnmaskedTUPseudo).TSFlags;
2397-
2398-
// Check that we're dropping the mask operand, and any policy operand
2399-
// when we transform to this unmasked tu pseudo.
2400-
assert(RISCVII::hasMergeOp(TSFlags) && RISCVII::hasDummyMaskOp(TSFlags) &&
2401-
!RISCVII::hasVecPolicyOp(TSFlags) &&
2402-
"Unexpected pseudo to transform to");
2403-
(void)TSFlags;
2404-
}
2405-
24062386
unsigned Opc = IsTA ? I->UnmaskedPseudo : I->UnmaskedTUPseudo;
2387+
2388+
// Check that we're dropping the mask operand and any policy operand
2389+
// when we transform to this unmasked pseudo. Additionally, if this insturtion
2390+
// is tail agnostic, the unmasked instruction should not have a merge op.
2391+
uint64_t TSFlags = TII.get(Opc).TSFlags;
2392+
assert((IsTA != RISCVII::hasMergeOp(TSFlags)) &&
2393+
RISCVII::hasDummyMaskOp(TSFlags) &&
2394+
!RISCVII::hasVecPolicyOp(TSFlags) &&
2395+
"Unexpected pseudo to transform to");
2396+
(void)TSFlags;
2397+
24072398
SmallVector<SDValue, 8> Ops;
24082399
// Skip the merge operand at index 0 if IsTA
24092400
for (unsigned I = IsTA, E = N->getNumOperands(); I != E; I++) {

0 commit comments

Comments
 (0)