[PATCH] D80027: Trivial fix for instruction with more than one destination in modulo peeler.

Thomas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 21 08:36:20 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG20c0527af744: [ModuloSchedule] Trivial fix for instruction with more than one destination in… (authored by ThomasR).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80027/new/

https://reviews.llvm.org/D80027

Files:
  llvm/lib/CodeGen/ModuloSchedule.cpp


Index: llvm/lib/CodeGen/ModuloSchedule.cpp
===================================================================
--- llvm/lib/CodeGen/ModuloSchedule.cpp
+++ llvm/lib/CodeGen/ModuloSchedule.cpp
@@ -1658,8 +1658,8 @@
     // 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);
     }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80027.265510.patch
Type: text/x-patch
Size: 691 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200521/65e4b51e/attachment.bin>


More information about the llvm-commits mailing list