Skip to content

Commit 8ec22b0

Browse files
committed
Address review comments
1 parent e2ba652 commit 8ec22b0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/lib/Target/RISCV/RISCVInstrInfo.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1727,7 +1727,7 @@ bool RISCVInstrInfo::areRVVInstsReassociable(const MachineInstr &MI1,
17271727
break;
17281728
}
17291729

1730-
if (It->definesRegister(RISCV::V0, TRI)) {
1730+
if (It->modifiesRegister(RISCV::V0, TRI)) {
17311731
Register SrcReg = It->getOperand(1).getReg();
17321732
// If it's not VReg it'll be more difficult to track its defs, so
17331733
// bailing out here just to be safe.
@@ -1844,8 +1844,7 @@ void RISCVInstrInfo::getReassociateOperandIndices(
18441844
const MachineInstr &Root, unsigned Pattern,
18451845
std::array<unsigned, 5> &OperandIndices) const {
18461846
TargetInstrInfo::getReassociateOperandIndices(Root, Pattern, OperandIndices);
1847-
if (isVectorAssociativeAndCommutative(Root) ||
1848-
isVectorAssociativeAndCommutative(Root, /*Invert=*/true)) {
1847+
if (RISCV::getRVVMCOpcode(Root.getOpcode())) {
18491848
// Skip the passthrough operand, so increment all indices by one.
18501849
for (unsigned I = 0; I < 5; ++I)
18511850
++OperandIndices[I];

0 commit comments

Comments
 (0)