aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachinePipeliner.cpp
diff options
context:
space:
mode:
authorMarianne Mailhot-Sarrasin <marianne.ms.qc@gmail.com>2021-02-17 12:14:03 -0500
committerMarianne Mailhot-Sarrasin <marianne.ms.qc@gmail.com>2021-02-17 12:28:37 -0500
commitf0ec9f1bb3f2236afaddc68bd6cb6f1e74c2a402 (patch)
tree80d61564c5f889c854dd22c3cb3731adb8b542f7 /llvm/lib/CodeGen/MachinePipeliner.cpp
parent40862b1a7486a969ff044cd240aad24f4183cc10 (diff)
downloadllvm-f0ec9f1bb3f2236afaddc68bd6cb6f1e74c2a402.zip
llvm-f0ec9f1bb3f2236afaddc68bd6cb6f1e74c2a402.tar.gz
llvm-f0ec9f1bb3f2236afaddc68bd6cb6f1e74c2a402.tar.bz2
[Pipeliner] Fixed optimization remarks and debug dumps Initiation
Interval value The II value was incremented before exiting the loop, and therefor when used in the optimization remarks and debug dumps it did not reflect the initiation interval actually used in Schedule. Differential Revision: https://reviews.llvm.org/D95692
Diffstat (limited to 'llvm/lib/CodeGen/MachinePipeliner.cpp')
-rw-r--r--llvm/lib/CodeGen/MachinePipeliner.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/MachinePipeliner.cpp b/llvm/lib/CodeGen/MachinePipeliner.cpp
index e09e5fd..7e5fa22 100644
--- a/llvm/lib/CodeGen/MachinePipeliner.cpp
+++ b/llvm/lib/CodeGen/MachinePipeliner.cpp
@@ -2034,9 +2034,8 @@ bool SwingSchedulerDAG::schedulePipeline(SMSchedule &Schedule) {
}
bool scheduleFound = false;
- unsigned II = 0;
// Keep increasing II until a valid schedule is found.
- for (II = MII; II <= MAX_II && !scheduleFound; ++II) {
+ for (unsigned II = MII; II <= MAX_II && !scheduleFound; ++II) {
Schedule.reset();
Schedule.setInitiationInterval(II);
LLVM_DEBUG(dbgs() << "Try to schedule with " << II << "\n");
@@ -2109,7 +2108,8 @@ bool SwingSchedulerDAG::schedulePipeline(SMSchedule &Schedule) {
scheduleFound = Schedule.isValidSchedule(this);
}
- LLVM_DEBUG(dbgs() << "Schedule Found? " << scheduleFound << " (II=" << II
+ LLVM_DEBUG(dbgs() << "Schedule Found? " << scheduleFound
+ << " (II=" << Schedule.getInitiationInterval()
<< ")\n");
if (scheduleFound) {
@@ -2117,7 +2117,8 @@ bool SwingSchedulerDAG::schedulePipeline(SMSchedule &Schedule) {
Pass.ORE->emit([&]() {
return MachineOptimizationRemarkAnalysis(
DEBUG_TYPE, "schedule", Loop.getStartLoc(), Loop.getHeader())
- << "Schedule found with Initiation Interval: " << ore::NV("II", II)
+ << "Schedule found with Initiation Interval: "
+ << ore::NV("II", Schedule.getInitiationInterval())
<< ", MaxStageCount: "
<< ore::NV("MaxStageCount", Schedule.getMaxStageCount());
});