Skip to content

Commit

Permalink
Include unstaged changes left behind
Browse files Browse the repository at this point in the history
  • Loading branch information
lukel97 committed Jan 3, 2024
1 parent f93af23 commit 4d7e2b7
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1482,10 +1482,6 @@ static bool canMutatePriorConfig(const MachineInstr &PrevMI,
return false;
}

if (MI.getOperand(1).isReg() &&
RISCV::X0 != MI.getOperand(1).getReg())
return false;

// Taken from MachineDominatorTree::dominates
auto Dominates = [](const MachineInstr &A, const MachineInstr &B) {
assert(A.getParent() == B.getParent());
Expand Down Expand Up @@ -1518,11 +1514,12 @@ static bool canMutatePriorConfig(const MachineInstr &PrevMI,

auto &AVL = MI.getOperand(1);
auto &PrevAVL = PrevMI.getOperand(1);
bool AreSameAVL = AVL.isReg() && PrevAVL.isReg() &&
AVL.getReg() == PrevAVL.getReg() &&
!IsDefinedBetween(AVL.getReg(), PrevMI, MI);
if (AVL.isReg() && AVL.getReg() != RISCV::X0 && !AreSameAVL)
return false;
if (AVL.isReg() && AVL.getReg() != RISCV::X0) {
bool AreSameAVL = PrevAVL.isReg() && AVL.getReg() == PrevAVL.getReg() &&
!IsDefinedBetween(AVL.getReg(), PrevMI, MI);
if (!AreSameAVL)
return false;
}
}

if (!PrevMI.getOperand(2).isImm() || !MI.getOperand(2).isImm())
Expand Down

0 comments on commit 4d7e2b7

Please sign in to comment.