[llvm] r283518 - [llvm-opt-report] Left justify unrolling counts, etc.
Hal Finkel via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 6 18:57:07 PDT 2016
Author: hfinkel
Date: Thu Oct 6 20:57:06 2016
New Revision: 283518
URL: http://llvm.org/viewvc/llvm-project?rev=283518&view=rev
Log:
[llvm-opt-report] Left justify unrolling counts, etc.
In the left part of the reports, we have things like U<number>; if some of
these numbers use more digits than others, we don't want a space in between the
U and the start of the number. Instead, the space should come afterward. This
way it is clear that the number goes with the U and not any other optimization
indicator that might come later on the line.
Added:
llvm/trunk/test/tools/llvm-opt-report/Inputs/unrl.c
llvm/trunk/test/tools/llvm-opt-report/Inputs/unrl.yaml
llvm/trunk/test/tools/llvm-opt-report/unrl.test
Added: llvm/trunk/test/tools/llvm-opt-report/Inputs/unrl.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-opt-report/Inputs/unrl.c?rev=283518&view=auto
==============================================================================
--- llvm/trunk/test/tools/llvm-opt-report/Inputs/unrl.c (added)
+++ llvm/trunk/test/tools/llvm-opt-report/Inputs/unrl.c Thu Oct 6 20:57:06 2016
@@ -0,0 +1,10 @@
+void bar();
+
+void foo() {
+ for (int i = 0; i < 5; ++i)
+ bar();
+
+ for (int i = 0; i < 11; ++i)
+ bar();
+}
+
Added: llvm/trunk/test/tools/llvm-opt-report/Inputs/unrl.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-opt-report/Inputs/unrl.yaml?rev=283518&view=auto
==============================================================================
--- llvm/trunk/test/tools/llvm-opt-report/Inputs/unrl.yaml (added)
+++ llvm/trunk/test/tools/llvm-opt-report/Inputs/unrl.yaml Thu Oct 6 20:57:06 2016
@@ -0,0 +1,42 @@
+--- !Missed
+Pass: inline
+Name: NoDefinition
+DebugLoc: { File: Inputs/unrl.c, Line: 5, Column: 5 }
+Function: foo
+Args:
+ - Callee: bar
+ - String: ' will not be inlined into '
+ - Caller: foo
+ - String: ' because its definition is unavailable'
+...
+--- !Missed
+Pass: inline
+Name: NoDefinition
+DebugLoc: { File: Inputs/unrl.c, Line: 8, Column: 5 }
+Function: foo
+Args:
+ - Callee: bar
+ - String: ' will not be inlined into '
+ - Caller: foo
+ - String: ' because its definition is unavailable'
+...
+--- !Passed
+Pass: loop-unroll
+Name: FullyUnrolled
+DebugLoc: { File: Inputs/unrl.c, Line: 7, Column: 3 }
+Function: foo
+Args:
+ - String: 'completely unrolled loop with '
+ - UnrollCount: '11'
+ - String: ' iterations'
+...
+--- !Passed
+Pass: loop-unroll
+Name: FullyUnrolled
+DebugLoc: { File: Inputs/unrl.c, Line: 4, Column: 3 }
+Function: foo
+Args:
+ - String: 'completely unrolled loop with '
+ - UnrollCount: '5'
+ - String: ' iterations'
+...
Added: llvm/trunk/test/tools/llvm-opt-report/unrl.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-opt-report/unrl.test?rev=283518&view=auto
==============================================================================
--- llvm/trunk/test/tools/llvm-opt-report/unrl.test (added)
+++ llvm/trunk/test/tools/llvm-opt-report/unrl.test Thu Oct 6 20:57:06 2016
@@ -0,0 +1,14 @@
+RUN: llvm-opt-report -r %p %p/Inputs/unrl.yaml | FileCheck -strict-whitespace %s
+
+; CHECK: < {{.*[/\]}}unrl.c
+; CHECK-NEXT: 1 | void bar();
+; CHECK-NEXT: 2 |
+; CHECK-NEXT: 3 | void foo() {
+; CHECK-NEXT: 4 U5 | for (int i = 0; i < 5; ++i)
+; CHECK-NEXT: 5 | bar();
+; CHECK-NEXT: 6 |
+; CHECK-NEXT: 7 U11 | for (int i = 0; i < 11; ++i)
+; CHECK-NEXT: 8 | bar();
+; CHECK-NEXT: 9 | }
+; CHECK-NEXT: 10 |
+
More information about the llvm-commits
mailing list