Skip to content

Commit 4d7e2b7

Browse files
committed
Include unstaged changes left behind
1 parent f93af23 commit 4d7e2b7

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp

+6-9
Original file line numberDiff line numberDiff line change
@@ -1482,10 +1482,6 @@ static bool canMutatePriorConfig(const MachineInstr &PrevMI,
14821482
return false;
14831483
}
14841484

1485-
if (MI.getOperand(1).isReg() &&
1486-
RISCV::X0 != MI.getOperand(1).getReg())
1487-
return false;
1488-
14891485
// Taken from MachineDominatorTree::dominates
14901486
auto Dominates = [](const MachineInstr &A, const MachineInstr &B) {
14911487
assert(A.getParent() == B.getParent());
@@ -1518,11 +1514,12 @@ static bool canMutatePriorConfig(const MachineInstr &PrevMI,
15181514

15191515
auto &AVL = MI.getOperand(1);
15201516
auto &PrevAVL = PrevMI.getOperand(1);
1521-
bool AreSameAVL = AVL.isReg() && PrevAVL.isReg() &&
1522-
AVL.getReg() == PrevAVL.getReg() &&
1523-
!IsDefinedBetween(AVL.getReg(), PrevMI, MI);
1524-
if (AVL.isReg() && AVL.getReg() != RISCV::X0 && !AreSameAVL)
1525-
return false;
1517+
if (AVL.isReg() && AVL.getReg() != RISCV::X0) {
1518+
bool AreSameAVL = PrevAVL.isReg() && AVL.getReg() == PrevAVL.getReg() &&
1519+
!IsDefinedBetween(AVL.getReg(), PrevMI, MI);
1520+
if (!AreSameAVL)
1521+
return false;
1522+
}
15261523
}
15271524

15281525
if (!PrevMI.getOperand(2).isImm() || !MI.getOperand(2).isImm())

0 commit comments

Comments
 (0)