Skip to content

Commit 18c4a08

Browse files
committed
fixup! [RISCV][MachineCombiner] Add reassociation optimizations for RVV instructions
1 parent 6ac5a84 commit 18c4a08

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

llvm/lib/Target/RISCV/RISCVInstrInfo.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1662,10 +1662,6 @@ bool RISCVInstrInfo::isVectorAssociativeAndCommutative(const MachineInstr &Inst,
16621662
OPCODE_LMUL_MASK_CASE(PseudoVADD_VV):
16631663
OPCODE_LMUL_CASE(PseudoVMUL_VV):
16641664
OPCODE_LMUL_MASK_CASE(PseudoVMUL_VV):
1665-
OPCODE_LMUL_CASE(PseudoVMULH_VV):
1666-
OPCODE_LMUL_MASK_CASE(PseudoVMULH_VV):
1667-
OPCODE_LMUL_CASE(PseudoVMULHU_VV):
1668-
OPCODE_LMUL_MASK_CASE(PseudoVMULHU_VV):
16691665
return true;
16701666
}
16711667
// clang-format on
@@ -1740,7 +1736,7 @@ bool RISCVInstrInfo::areRVVInstsReassociable(const MachineInstr &MI1,
17401736
return true;
17411737
}
17421738

1743-
// Most of our RVV pseudo has passthru operand, so the real operands
1739+
// Most of our RVV pseudos have passthru operand, so the real operands
17441740
// start from index = 2.
17451741
bool RISCVInstrInfo::hasReassociableVectorSibling(const MachineInstr &Inst,
17461742
bool &Commuted) const {
@@ -1792,7 +1788,7 @@ void RISCVInstrInfo::getReassociateOperandIndices(
17921788
TargetInstrInfo::getReassociateOperandIndices(Root, Pattern, OperandIndices);
17931789
if (isVectorAssociativeAndCommutative(Root) ||
17941790
isVectorAssociativeAndCommutative(Root, /*Invert=*/true)) {
1795-
// Skip the passthrough operand, so add all indices by one.
1791+
// Skip the passthrough operand, so increment all indices by one.
17961792
for (unsigned I = 0; I < 5; ++I)
17971793
++OperandIndices[I];
17981794
}

0 commit comments

Comments
 (0)