@@ -2383,27 +2383,18 @@ bool RISCVDAGToDAGISel::doPeepholeMaskedRVV(SDNode *N) {
2383
2383
}
2384
2384
}
2385
2385
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
-
2406
2386
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
+
2407
2398
SmallVector<SDValue, 8 > Ops;
2408
2399
// Skip the merge operand at index 0 if IsTA
2409
2400
for (unsigned I = IsTA, E = N->getNumOperands (); I != E; I++) {
0 commit comments