[PATCH] D71122: [ModuloSchedule] Fix data types in ModuloScheduleExpander::isLoopCarried

Masaki Arai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 6 08:30:48 PST 2019


masakiarai created this revision.
masakiarai added reviewers: jmolloy, ThomasRaoux.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.

The cycle values in modulo scheduling results can be negative.
The result of ModuloSchedule::getCycle() must be received as an int type.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D71122

Files:
  llvm/lib/CodeGen/ModuloSchedule.cpp


Index: llvm/lib/CodeGen/ModuloSchedule.cpp
===================================================================
--- llvm/lib/CodeGen/ModuloSchedule.cpp
+++ llvm/lib/CodeGen/ModuloSchedule.cpp
@@ -1190,7 +1190,7 @@
 bool ModuloScheduleExpander::isLoopCarried(MachineInstr &Phi) {
   if (!Phi.isPHI())
     return false;
-  unsigned DefCycle = Schedule.getCycle(&Phi);
+  int DefCycle = Schedule.getCycle(&Phi);
   int DefStage = Schedule.getStage(&Phi);
 
   unsigned InitVal = 0;
@@ -1199,7 +1199,7 @@
   MachineInstr *Use = MRI.getVRegDef(LoopVal);
   if (!Use || Use->isPHI())
     return true;
-  unsigned LoopCycle = Schedule.getCycle(Use);
+  int LoopCycle = Schedule.getCycle(Use);
   int LoopStage = Schedule.getStage(Use);
   return (LoopCycle > DefCycle) || (LoopStage <= DefStage);
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71122.232574.patch
Type: text/x-patch
Size: 794 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191206/fe42f22b/attachment.bin>


More information about the llvm-commits mailing list