[llvm] r370894 - [ModuloSchedule] Fix no-asserts build
James Molloy via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 4 05:57:23 PDT 2019
Author: jamesm
Date: Wed Sep 4 05:57:23 2019
New Revision: 370894
URL: http://llvm.org/viewvc/llvm-project?rev=370894&view=rev
Log:
[ModuloSchedule] Fix no-asserts build
Apologies, due to a git SNAFU this fix (dump doesn't exist and silence unused variables) stayed in my index rather than applying to rL370893.
Modified:
llvm/trunk/lib/CodeGen/ModuloSchedule.cpp
Modified: llvm/trunk/lib/CodeGen/ModuloSchedule.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ModuloSchedule.cpp?rev=370894&r1=370893&r2=370894&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/ModuloSchedule.cpp (original)
+++ llvm/trunk/lib/CodeGen/ModuloSchedule.cpp Wed Sep 4 05:57:23 2019
@@ -1386,8 +1386,6 @@ Register KernelRewriter::remapUse(Regist
assert(LoopProducer);
}
int LoopProducerStage = S.getStage(LoopProducer);
- int LoopProducerCycle = S.getCycle(LoopProducer);
- int ConsumerCycle = S.getCycle(&MI);
Optional<Register> IllegalPhiDefault;
@@ -1396,7 +1394,12 @@ Register KernelRewriter::remapUse(Regist
} else if (LoopProducerStage > ConsumerStage) {
// This schedule is only representable if ProducerStage == ConsumerStage+1.
// In addition, Consumer's cycle must be scheduled after Producer in the
- // rescheduled loop.
+ // rescheduled loop. This is enforced by the pipeliner's ASAP and ALAP
+ // functions.
+#ifndef NDEBUG // Silence unused variables in non-asserts mode.
+ int LoopProducerCycle = S.getCycle(LoopProducer);
+ int ConsumerCycle = S.getCycle(&MI);
+#endif
assert(LoopProducerCycle <= ConsumerCycle);
assert(LoopProducerStage == ConsumerStage + 1);
// Peel off the first phi from Defaults and insert a phi between producer
@@ -1637,9 +1640,9 @@ void PeelingModuloScheduleExpander::vali
if (Failed) {
errs() << "Golden reference kernel:\n";
- ExpandedKernel->dump();
+ ExpandedKernel->print(errs());
errs() << "New kernel:\n";
- BB->dump();
+ BB->print(errs());
errs() << ScheduleDump;
report_fatal_error(
"Modulo kernel validation (-pipeliner-experimental-cg) failed");
More information about the llvm-commits
mailing list