aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/ModuloSchedule.cpp
diff options
context:
space:
mode:
authorThomas Raoux <thomasraoux@google.com>2020-05-21 08:14:42 -0700
committerThomas Raoux <thomasraoux@google.com>2020-05-21 08:14:42 -0700
commit20c0527af7449d7c22261f9bc88b0ee391bdbad8 (patch)
tree658609ed1e2fcbcbca3316b41f48b14e69588ec2 /llvm/lib/CodeGen/ModuloSchedule.cpp
parent3ef11346f391e6e3da0cfa25f9f7dac22771438e (diff)
downloadllvm-20c0527af7449d7c22261f9bc88b0ee391bdbad8.zip
llvm-20c0527af7449d7c22261f9bc88b0ee391bdbad8.tar.gz
llvm-20c0527af7449d7c22261f9bc88b0ee391bdbad8.tar.bz2
[ModuloSchedule] Trivial fix for instruction with more than one destination in modulo peeler.
When moving an instruction into a block where it was referenced by a phi when peeling, refer to the phi's register number and assert that the instruction has it in its destinations. This way, it also covers instructions with more than one destination. Patch by Hendrik Greving! Differential Revision: https://reviews.llvm.org/D80027
Diffstat (limited to 'llvm/lib/CodeGen/ModuloSchedule.cpp')
-rw-r--r--llvm/lib/CodeGen/ModuloSchedule.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/ModuloSchedule.cpp b/llvm/lib/CodeGen/ModuloSchedule.cpp
index 65dc11e..944a295 100644
--- a/llvm/lib/CodeGen/ModuloSchedule.cpp
+++ b/llvm/lib/CodeGen/ModuloSchedule.cpp
@@ -1658,8 +1658,8 @@ void PeelingModuloScheduleExpander::moveStageBetweenBlocks(
// we don't need the phi anymore.
if (getStage(Def) == Stage) {
Register PhiReg = MI.getOperand(0).getReg();
- MRI.replaceRegWith(MI.getOperand(0).getReg(),
- Def->getOperand(0).getReg());
+ assert(Def->findRegisterDefOperandIdx(MI.getOperand(1).getReg()) != -1);
+ MRI.replaceRegWith(MI.getOperand(0).getReg(), MI.getOperand(1).getReg());
MI.getOperand(0).setReg(PhiReg);
PhiToDelete.push_back(&MI);
}