Add an extra command line option to llc that allows checking at what cycle an instruction has been scheduled by the machine scheduler.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/test/CodeGen/AArch64/sched-print-cycle.mir | ||
---|---|---|
19 | Should this not check for the expected cycles? |
llvm/test/CodeGen/AArch64/sched-print-cycle.mir | ||
---|---|---|
19 | I could, but what I am really interested in checking is the fact that we get 2 extra numbers with the option, not their values (for now). The scheduler tests will take care of checking the actual values. Is it OK if I live it as it is? |
llvm/test/CodeGen/AArch64/sched-print-cycle.mir | ||
---|---|---|
19 | To be more precise, I do not want to check for specific value because I do not want to bother updating the test in case they change. All I care is that the two extra numbers are there when -sched-print-cycles=true |
llvm/lib/CodeGen/ScheduleDAG.cpp | ||
---|---|---|
366 ↗ | (On Diff #487446) | Hmm, is there a reason for including it in the name and not including them among the attributes (SUnit::dumpAttributes)? There it would also be possible to print a name associated with the values. |
llvm/test/CodeGen/AArch64/sched-print-cycle.mir | ||
19 | If you fix the CPU (-mcpu=xxx) to an older one, it's unlikely that the latencies for ADD will change? It seems better to check that the correct values are printed IMO , rather than matching any value. |
I have specified -mcpu in the test and the resulting values printed in the SUnit dump.
llvm/test/CodeGen/AArch64/sched-print-cycle.mir | ||
---|---|---|
19 | You win :) |
llvm/lib/CodeGen/ScheduleDAG.cpp | ||
---|---|---|
366 ↗ | (On Diff #487446) | It is because we want the information to be printed by void ScheduleDAGMI::dumpSchedule() const, so that we can check the last bits of the debug info of the machine scheduler right after the string *** Final schedule for %bb.0 ***. As far as I understand SUnit::dumpAttributes is printed before the scheduler does its job. We need to check the two extra values when the scheduler has finished. |
Specify -mtriple in the invocation of llc in the test to prevent it fail on targets that do not support the cpu specified.
Based on offline feedback from @fhahn, I have:
- moved the implementation out of dumpNodeName into ScheduleDAGInstrs::dumpNode(const SUnit &SU)
- printed the meaning of the values.
Update the example in the test to have non-zero values printed for both TopReadyCycle and BottomReadyCycle.
Should this not check for the expected cycles?