aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-mca
diff options
context:
space:
mode:
authorJay Foad <jay.foad@amd.com>2021-06-24 11:00:13 +0100
committerJay Foad <jay.foad@amd.com>2021-06-24 12:54:57 +0100
commitbeebe5a056b8d4d224b07c5039f8e6028a7afb4c (patch)
treef6f9d97b104f807e09642e772d02cd52402ffac3 /llvm/tools/llvm-mca
parenta54c6fc083c45595466c2d3d73ccf80c07ef1247 (diff)
downloadllvm-beebe5a056b8d4d224b07c5039f8e6028a7afb4c.zip
llvm-beebe5a056b8d4d224b07c5039f8e6028a7afb4c.tar.gz
llvm-beebe5a056b8d4d224b07c5039f8e6028a7afb4c.tar.bz2
[MCA] Allow unlimited cycles in the timeline view
Change --max-timeline-cycles=0 to mean no limit on the number of cycles. Use this in AMDGPU tests to show all instructions in the timeline view instead of having it arbitrarily truncated. Differential Revision: https://reviews.llvm.org/D104846
Diffstat (limited to 'llvm/tools/llvm-mca')
-rw-r--r--llvm/tools/llvm-mca/Views/TimelineView.cpp4
-rw-r--r--llvm/tools/llvm-mca/llvm-mca.cpp10
2 files changed, 7 insertions, 7 deletions
diff --git a/llvm/tools/llvm-mca/Views/TimelineView.cpp b/llvm/tools/llvm-mca/Views/TimelineView.cpp
index df536b4..9a94976 100644
--- a/llvm/tools/llvm-mca/Views/TimelineView.cpp
+++ b/llvm/tools/llvm-mca/Views/TimelineView.cpp
@@ -21,8 +21,8 @@ TimelineView::TimelineView(const MCSubtargetInfo &sti, MCInstPrinter &Printer,
llvm::ArrayRef<llvm::MCInst> S, unsigned Iterations,
unsigned Cycles)
: InstructionView(sti, Printer, S), CurrentCycle(0),
- MaxCycle(Cycles == 0 ? 80 : Cycles), LastCycle(0), WaitTime(S.size()),
- UsedBuffer(S.size()) {
+ MaxCycle(Cycles == 0 ? std::numeric_limits<unsigned>::max() : Cycles),
+ LastCycle(0), WaitTime(S.size()), UsedBuffer(S.size()) {
unsigned NumInstructions = getSource().size();
assert(Iterations && "Invalid number of iterations specified!");
NumInstructions *= Iterations;
diff --git a/llvm/tools/llvm-mca/llvm-mca.cpp b/llvm/tools/llvm-mca/llvm-mca.cpp
index 4e47762..d35ba0d 100644
--- a/llvm/tools/llvm-mca/llvm-mca.cpp
+++ b/llvm/tools/llvm-mca/llvm-mca.cpp
@@ -176,11 +176,11 @@ static cl::opt<unsigned> TimelineMaxIterations(
cl::desc("Maximum number of iterations to print in timeline view"),
cl::cat(ViewOptions), cl::init(0));
-static cl::opt<unsigned> TimelineMaxCycles(
- "timeline-max-cycles",
- cl::desc(
- "Maximum number of cycles in the timeline view. Defaults to 80 cycles"),
- cl::cat(ViewOptions), cl::init(80));
+static cl::opt<unsigned>
+ TimelineMaxCycles("timeline-max-cycles",
+ cl::desc("Maximum number of cycles in the timeline view, "
+ "or 0 for unlimited. Defaults to 80 cycles"),
+ cl::cat(ViewOptions), cl::init(80));
static cl::opt<bool>
AssumeNoAlias("noalias",