[llvm] r329680 - Reapply "[llvm-mca] Do not separate iterations with a newline in the timeline view."
Andrea Di Biagio via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 10 02:55:33 PDT 2018
Author: adibiagio
Date: Tue Apr 10 02:55:33 2018
New Revision: 329680
URL: http://llvm.org/viewvc/llvm-project?rev=329680&view=rev
Log:
Reapply "[llvm-mca] Do not separate iterations with a newline in the timeline view."
This reapplies r329403 with a fix for the floating point rounding issue.
Modified:
llvm/trunk/test/tools/llvm-mca/AArch64/CortexA57/direct-branch.s
llvm/trunk/test/tools/llvm-mca/AArch64/Exynos/direct-branch.s
llvm/trunk/test/tools/llvm-mca/AArch64/Exynos/scheduler-queue-usage.s
llvm/trunk/test/tools/llvm-mca/X86/BtVer2/dot-product.s
llvm/trunk/test/tools/llvm-mca/X86/BtVer2/pipes-fpu.s
llvm/trunk/test/tools/llvm-mca/X86/BtVer2/register-files-1.s
llvm/trunk/test/tools/llvm-mca/X86/BtVer2/register-files-2.s
llvm/trunk/test/tools/llvm-mca/X86/BtVer2/register-files-3.s
llvm/trunk/test/tools/llvm-mca/X86/BtVer2/register-files-4.s
llvm/trunk/tools/llvm-mca/ResourcePressureView.cpp
llvm/trunk/tools/llvm-mca/TimelineView.cpp
Modified: llvm/trunk/test/tools/llvm-mca/AArch64/CortexA57/direct-branch.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-mca/AArch64/CortexA57/direct-branch.s?rev=329680&r1=329679&r2=329680&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-mca/AArch64/CortexA57/direct-branch.s (original)
+++ llvm/trunk/test/tools/llvm-mca/AArch64/CortexA57/direct-branch.s Tue Apr 10 02:55:33 2018
@@ -1,4 +1,4 @@
-# RUN: llvm-mca -march=aarch64 -mcpu=cortex-a57 -iterations=600 -timeline < %s | FileCheck %s
+# RUN: llvm-mca -march=aarch64 -mcpu=cortex-a57 -iterations=600 -timeline -timeline-max-iterations=4 < %s | FileCheck %s
b t
@@ -42,13 +42,12 @@
# CHECK: Timeline view:
-# CHECK-NEXT: 012
-# CHECK-NEXT: Index 0123456789
+# CHECK: Index 0123456
-# CHECK: [0,0] DeER . . . b t
-# CHECK: [1,0] D=eER. . . b t
-# CHECK: [2,0] D==eER . . b t
-# CHECK: [3,0] .D==eER . . b t
+# CHECK: [0,0] DeER .. b t
+# CHECK-NEXT: [1,0] D=eER.. b t
+# CHECK-NEXT: [2,0] D==eER. b t
+# CHECK-NEXT: [3,0] .D==eER b t
# CHECK: Average Wait times (based on the timeline view):
@@ -58,4 +57,4 @@
# CHECK-NEXT: [3]: Average time elapsed from WB until retire stage
# CHECK: [0] [1] [2] [3]
-# CHECK-NEXT: 0. 10 4.3 4.3 0.0 b t
+# CHECK-NEXT: 0. 4 2.3 2.3 0.0 b t
Modified: llvm/trunk/test/tools/llvm-mca/AArch64/Exynos/direct-branch.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-mca/AArch64/Exynos/direct-branch.s?rev=329680&r1=329679&r2=329680&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-mca/AArch64/Exynos/direct-branch.s (original)
+++ llvm/trunk/test/tools/llvm-mca/AArch64/Exynos/direct-branch.s Tue Apr 10 02:55:33 2018
@@ -1,5 +1,5 @@
-# RUN: llvm-mca -march=aarch64 -mcpu=exynos-m3 -iterations=300 -timeline < %s | FileCheck %s -check-prefix=ALL -check-prefix=M3
-# RUN: llvm-mca -march=aarch64 -mcpu=exynos-m1 -iterations=300 -timeline < %s | FileCheck %s -check-prefix=ALL -check-prefix=M1
+# RUN: llvm-mca -march=aarch64 -mcpu=exynos-m3 -iterations=300 -timeline -timeline-max-iterations=3 -resource-pressure=false < %s | FileCheck %s -check-prefix=ALL -check-prefix=M3
+# RUN: llvm-mca -march=aarch64 -mcpu=exynos-m1 -iterations=300 -timeline -timeline-max-iterations=3 -resource-pressure=false < %s | FileCheck %s -check-prefix=ALL -check-prefix=M1
b t
@@ -34,4 +34,4 @@
# ALL-NEXT: [3]: Average time elapsed from WB until retire stage
# ALL: [0] [1] [2] [3]
-# ALL-NEXT: 0. 10 0.0 0.0 0.0 b t
+# ALL-NEXT: 0. 3 0.0 0.0 0.0 b t
Modified: llvm/trunk/test/tools/llvm-mca/AArch64/Exynos/scheduler-queue-usage.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-mca/AArch64/Exynos/scheduler-queue-usage.s?rev=329680&r1=329679&r2=329680&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-mca/AArch64/Exynos/scheduler-queue-usage.s (original)
+++ llvm/trunk/test/tools/llvm-mca/AArch64/Exynos/scheduler-queue-usage.s Tue Apr 10 02:55:33 2018
@@ -1,5 +1,5 @@
-# RUN: llvm-mca -march=aarch64 -mcpu=exynos-m3 -iterations=1 -verbose < %s | FileCheck %s -check-prefix=ALL
-# RUN: llvm-mca -march=aarch64 -mcpu=exynos-m1 -iterations=1 -verbose < %s | FileCheck %s -check-prefix=ALL
+# RUN: llvm-mca -march=aarch64 -mcpu=exynos-m3 -iterations=1 -verbose -resource-pressure=false -instruction-info=false < %s | FileCheck %s -check-prefix=ALL
+# RUN: llvm-mca -march=aarch64 -mcpu=exynos-m1 -iterations=1 -verbose -resource-pressure=false -instruction-info=false < %s | FileCheck %s -check-prefix=ALL
b t
Modified: llvm/trunk/test/tools/llvm-mca/X86/BtVer2/dot-product.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-mca/X86/BtVer2/dot-product.s?rev=329680&r1=329679&r2=329680&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-mca/X86/BtVer2/dot-product.s (original)
+++ llvm/trunk/test/tools/llvm-mca/X86/BtVer2/dot-product.s Tue Apr 10 02:55:33 2018
@@ -59,10 +59,10 @@ vhaddps %xmm3, %xmm3, %xmm4
# CHECK: [0,0] DeeER. . . vmulps %xmm0, %xmm1, %xmm2
# CHECK-NEXT: [0,1] D==eeeER . . vhaddps %xmm2, %xmm2, %xmm3
# CHECK-NEXT: [0,2] .D====eeeER . vhaddps %xmm3, %xmm3, %xmm4
-# CHECK: [1,0] .DeeE-----R . vmulps %xmm0, %xmm1, %xmm2
+# CHECK-NEXT: [1,0] .DeeE-----R . vmulps %xmm0, %xmm1, %xmm2
# CHECK-NEXT: [1,1] . D=eeeE---R . vhaddps %xmm2, %xmm2, %xmm3
# CHECK-NEXT: [1,2] . D====eeeER . vhaddps %xmm3, %xmm3, %xmm4
-# CHECK: [2,0] . DeeE-----R . vmulps %xmm0, %xmm1, %xmm2
+# CHECK-NEXT: [2,0] . DeeE-----R . vmulps %xmm0, %xmm1, %xmm2
# CHECK-NEXT: [2,1] . D====eeeER . vhaddps %xmm2, %xmm2, %xmm3
# CHECK-NEXT: [2,2] . D======eeeER vhaddps %xmm3, %xmm3, %xmm4
Modified: llvm/trunk/test/tools/llvm-mca/X86/BtVer2/pipes-fpu.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-mca/X86/BtVer2/pipes-fpu.s?rev=329680&r1=329679&r2=329680&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-mca/X86/BtVer2/pipes-fpu.s (original)
+++ llvm/trunk/test/tools/llvm-mca/X86/BtVer2/pipes-fpu.s Tue Apr 10 02:55:33 2018
@@ -87,7 +87,7 @@ vsqrtps %ymm0, %ymm2
# CHECK-NEXT: [0,5] . DeeeeeeeeeeeeeeeeeeeeeER . . . . . . . . . vsqrtps %xmm0, %xmm2
# CHECK-NEXT: [0,6] . DeeeE-----------------R . . . . . . . . . vaddps %ymm0, %ymm1, %ymm2
# CHECK-NEXT: [0,7] . D===================eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeER . vsqrtps %ymm0, %ymm2
-# CHECK: [1,0] . .DeeeeE--------------------------------------------------------R . vpmulld %xmm0, %xmm1, %xmm2
+# CHECK-NEXT: [1,0] . .DeeeeE--------------------------------------------------------R . vpmulld %xmm0, %xmm1, %xmm2
# CHECK-NEXT: [1,1] . . DeE-----------------------------------------------------------R. vpand %xmm0, %xmm1, %xmm2
# CHECK-NEXT: [1,2] . . DeeeE--------------------------------------------------------R. vcvttps2dq %xmm0, %xmm2
# CHECK-NEXT: [1,3] . . DeeE----------------------------------------------------------R vpclmulqdq $0, %xmm0, %xmm1, %xmm2
Modified: llvm/trunk/test/tools/llvm-mca/X86/BtVer2/register-files-1.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-mca/X86/BtVer2/register-files-1.s?rev=329680&r1=329679&r2=329680&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-mca/X86/BtVer2/register-files-1.s (original)
+++ llvm/trunk/test/tools/llvm-mca/X86/BtVer2/register-files-1.s Tue Apr 10 02:55:33 2018
@@ -1,4 +1,4 @@
-# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -iterations=5 -verbose -register-file-stats -timeline < %s | FileCheck %s
+# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -iterations=5 -verbose -instruction-info=false -register-file-stats -timeline < %s | FileCheck %s
vaddps %xmm0, %xmm0, %xmm0
vmulps %xmm0, %xmm0, %xmm0
@@ -34,13 +34,14 @@ vmulps %xmm0, %xmm0, %xmm0
# CHECK: Timeline view:
# CHECK-NEXT: 0123456789
# CHECK-NEXT: Index 0123456789 01234567
+
# CHECK: [0,0] DeeeER . . . . . vaddps %xmm0, %xmm0, %xmm0
# CHECK-NEXT: [0,1] D===eeER . . . . . vmulps %xmm0, %xmm0, %xmm0
-# CHECK: [1,0] .D====eeeER . . . . vaddps %xmm0, %xmm0, %xmm0
+# CHECK-NEXT: [1,0] .D====eeeER . . . . vaddps %xmm0, %xmm0, %xmm0
# CHECK-NEXT: [1,1] .D=======eeER . . . . vmulps %xmm0, %xmm0, %xmm0
-# CHECK: [2,0] . D========eeeER . . . vaddps %xmm0, %xmm0, %xmm0
+# CHECK-NEXT: [2,0] . D========eeeER . . . vaddps %xmm0, %xmm0, %xmm0
# CHECK-NEXT: [2,1] . D===========eeER . . . vmulps %xmm0, %xmm0, %xmm0
-# CHECK: [3,0] . D============eeeER . . vaddps %xmm0, %xmm0, %xmm0
+# CHECK-NEXT: [3,0] . D============eeeER . . vaddps %xmm0, %xmm0, %xmm0
# CHECK-NEXT: [3,1] . D===============eeER . . vmulps %xmm0, %xmm0, %xmm0
-# CHECK: [4,0] . D================eeeER . vaddps %xmm0, %xmm0, %xmm0
+# CHECK-NEXT: [4,0] . D================eeeER . vaddps %xmm0, %xmm0, %xmm0
# CHECK-NEXT: [4,1] . D===================eeER vmulps %xmm0, %xmm0, %xmm0
Modified: llvm/trunk/test/tools/llvm-mca/X86/BtVer2/register-files-2.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-mca/X86/BtVer2/register-files-2.s?rev=329680&r1=329679&r2=329680&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-mca/X86/BtVer2/register-files-2.s (original)
+++ llvm/trunk/test/tools/llvm-mca/X86/BtVer2/register-files-2.s Tue Apr 10 02:55:33 2018
@@ -1,4 +1,4 @@
-# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -register-file-size=5 -iterations=5 -verbose -register-file-stats -timeline < %s | FileCheck %s
+# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -register-file-size=5 -iterations=5 -verbose -instruction-info=false -register-file-stats -timeline < %s | FileCheck %s
vaddps %xmm0, %xmm0, %xmm0
vmulps %xmm0, %xmm0, %xmm0
@@ -36,11 +36,11 @@ vmulps %xmm0, %xmm0, %xmm0
# CHECK-NEXT: Index 0123456789 01234567
# CHECK: [0,0] DeeeER . . . . . vaddps %xmm0, %xmm0, %xmm0
# CHECK-NEXT: [0,1] D===eeER . . . . . vmulps %xmm0, %xmm0, %xmm0
-# CHECK: [1,0] .D====eeeER . . . . vaddps %xmm0, %xmm0, %xmm0
+# CHECK-NEXT: [1,0] .D====eeeER . . . . vaddps %xmm0, %xmm0, %xmm0
# CHECK-NEXT: [1,1] .D=======eeER . . . . vmulps %xmm0, %xmm0, %xmm0
-# CHECK: [2,0] . D========eeeER . . . vaddps %xmm0, %xmm0, %xmm0
+# CHECK-NEXT: [2,0] . D========eeeER . . . vaddps %xmm0, %xmm0, %xmm0
# CHECK-NEXT: [2,1] . D========eeER . . . vmulps %xmm0, %xmm0, %xmm0
-# CHECK: [3,0] . . D========eeeER . . vaddps %xmm0, %xmm0, %xmm0
+# CHECK-NEXT: [3,0] . . D========eeeER . . vaddps %xmm0, %xmm0, %xmm0
# CHECK-NEXT: [3,1] . . D========eeER . . vmulps %xmm0, %xmm0, %xmm0
-# CHECK: [4,0] . . . D========eeeER . vaddps %xmm0, %xmm0, %xmm0
+# CHECK-NEXT: [4,0] . . . D========eeeER . vaddps %xmm0, %xmm0, %xmm0
# CHECK-NEXT: [4,1] . . . D========eeER vmulps %xmm0, %xmm0, %xmm0
Modified: llvm/trunk/test/tools/llvm-mca/X86/BtVer2/register-files-3.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-mca/X86/BtVer2/register-files-3.s?rev=329680&r1=329679&r2=329680&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-mca/X86/BtVer2/register-files-3.s (original)
+++ llvm/trunk/test/tools/llvm-mca/X86/BtVer2/register-files-3.s Tue Apr 10 02:55:33 2018
@@ -46,4 +46,4 @@ idiv %eax
# CHECK-NEXT: Index 0123456789 0123456789 0123456789
# CHECK: [0,0] DeeeeeeeeeeeeeeeeeeeeeeeeeER . . . . . . idivl %eax
-# CHECK: [1,0] . . . . . . DeeeeeeeeeeeeeeeeeeeeeeeeeER idivl %eax
+# CHECK-NEXT: [1,0] . . . . . . DeeeeeeeeeeeeeeeeeeeeeeeeeER idivl %eax
Modified: llvm/trunk/test/tools/llvm-mca/X86/BtVer2/register-files-4.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-mca/X86/BtVer2/register-files-4.s?rev=329680&r1=329679&r2=329680&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-mca/X86/BtVer2/register-files-4.s (original)
+++ llvm/trunk/test/tools/llvm-mca/X86/BtVer2/register-files-4.s Tue Apr 10 02:55:33 2018
@@ -1,4 +1,4 @@
-# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -iterations=22 -verbose -register-file-stats -timeline -timeline-max-iterations=3 < %s | FileCheck %s
+# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -iterations=22 -verbose -register-file-stats -resource-pressure=false -timeline -timeline-max-iterations=3 < %s | FileCheck %s
idiv %eax
@@ -45,5 +45,5 @@ idiv %eax
# CHECK-NEXT: 0123456789 0123456789 0123456789 01234567
# CHECK-NEXT: Index 0123456789 0123456789 0123456789 0123456789
# CHECK: [0,0] DeeeeeeeeeeeeeeeeeeeeeeeeeER . . . . . . . . . . . idivl %eax
-# CHECK: [1,0] .D========================eeeeeeeeeeeeeeeeeeeeeeeeeER . . . . . . idivl %eax
-# CHECK: [2,0] . D================================================eeeeeeeeeeeeeeeeeeeeeeeeeER idivl %eax
+# CHECK-NEXT: [1,0] .D========================eeeeeeeeeeeeeeeeeeeeeeeeeER . . . . . . idivl %eax
+# CHECK-NEXT: [2,0] . D================================================eeeeeeeeeeeeeeeeeeeeeeeeeER idivl %eax
Modified: llvm/trunk/tools/llvm-mca/ResourcePressureView.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mca/ResourcePressureView.cpp?rev=329680&r1=329679&r2=329680&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mca/ResourcePressureView.cpp (original)
+++ llvm/trunk/tools/llvm-mca/ResourcePressureView.cpp Tue Apr 10 02:55:33 2018
@@ -120,7 +120,8 @@ void ResourcePressureView::printResource
}
double Pressure = Usage / Executions;
- TempStream << format("%.2f", Pressure);
+ // Round to the value to the nearest hundredth and then print it.
+ TempStream << format("%.2f", floor((Pressure * 100) + 0.5)/100);
if (Pressure < 10.0)
TempStream << " ";
else if (Pressure < 100.0)
Modified: llvm/trunk/tools/llvm-mca/TimelineView.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mca/TimelineView.cpp?rev=329680&r1=329679&r2=329680&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mca/TimelineView.cpp (original)
+++ llvm/trunk/tools/llvm-mca/TimelineView.cpp Tue Apr 10 02:55:33 2018
@@ -72,6 +72,17 @@ void TimelineView::onInstructionEvent(co
LastCycle = std::max(LastCycle, CurrentCycle);
}
+static void printAverageTime(raw_string_ostream &OS, double AverageTime) {
+ // Round to the nearest tenth.
+ OS << format("%.1f", floor((AverageTime * 10) + 0.5)/10);
+ if (AverageTime < 10.0)
+ OS << " ";
+ else if (AverageTime < 100.0)
+ OS << " ";
+ else
+ OS << " ";
+}
+
void TimelineView::printWaitTimeEntry(raw_string_ostream &OS,
const WaitTimeEntry &Entry,
unsigned SourceIndex) const {
@@ -100,27 +111,9 @@ void TimelineView::printWaitTimeEntry(ra
else
OS << Executions << " ";
- OS << format("%.1f", AverageTime1);
- if (AverageTime1 < 10.0)
- OS << " ";
- else if (AverageTime1 < 100.0)
- OS << " ";
- else
- OS << " ";
-
- OS << format("%.1f", AverageTime2);
- if (AverageTime2 < 10.0)
- OS << " ";
- else if (AverageTime2 < 100.0)
- OS << " ";
- else
- OS << " ";
-
- OS << format("%.1f", AverageTime3);
- if (AverageTime3 < 10.0)
- OS << " ";
- else if (AverageTime3 < 100.0)
- OS << ' ';
+ printAverageTime(OS, AverageTime1);
+ printAverageTime(OS, AverageTime2);
+ printAverageTime(OS, AverageTime3);
}
}
@@ -155,7 +148,7 @@ void TimelineView::printTimelineViewEntr
const TimelineViewEntry &Entry,
unsigned Iteration,
unsigned SourceIndex) const {
- if (SourceIndex == 0)
+ if (Iteration == 0 && SourceIndex == 0)
OS << '\n';
OS << '[' << Iteration << ',' << SourceIndex << "]\t";
for (unsigned I = 0, E = Entry.CycleDispatched; I < E; ++I)
More information about the llvm-commits
mailing list