Skip to content

Commit 7b51909

Browse files
committed
Move MaskOpIdx closer to the use site
1 parent 02e4c95 commit 7b51909

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Target/RISCV/RISCVFoldMasks.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,8 +445,6 @@ bool RISCVFoldMasks::convertToUnmasked(MachineInstr &MI,
445445
if (!I)
446446
return false;
447447

448-
// TODO: Increment all MaskOpIdxs in tablegen by num of explicit defs?
449-
unsigned MaskOpIdx = I->MaskOpIdx + MI.getNumExplicitDefs();
450448
if (!isAllOnesMask(MaskDef))
451449
return false;
452450

@@ -465,6 +463,9 @@ bool RISCVFoldMasks::convertToUnmasked(MachineInstr &MI,
465463
#endif
466464

467465
MI.setDesc(MCID);
466+
467+
// TODO: Increment all MaskOpIdxs in tablegen by num of explicit defs?
468+
unsigned MaskOpIdx = I->MaskOpIdx + MI.getNumExplicitDefs();
468469
MI.removeOperand(MaskOpIdx);
469470

470471
// The unmasked pseudo will no longer be constrained to the vrnov0 reg class,

0 commit comments

Comments
 (0)