[polly] r252602 - ScopInfo: Make printing of ScopArrayInfo more similar to declarations in C
Tobias Grosser via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 10 06:02:54 PST 2015
Author: grosser
Date: Tue Nov 10 08:02:54 2015
New Revision: 252602
URL: http://llvm.org/viewvc/llvm-project?rev=252602&view=rev
Log:
ScopInfo: Make printing of ScopArrayInfo more similar to declarations in C
Memory references are now printed as follows:
Old New
Scalars: i64 MemRef_val[*] i64 MemRef_val;
Arrays: i64 MemRef_A[*][%m][%o][8] i64 MemRef_A[*][%m][%o];
We do not print any more information about the element size in the type. Such
information has already been available in a comment after the scalar/array
declaration. It was redundant and did not match well with what people were used
from C.
Modified:
polly/trunk/lib/Analysis/ScopInfo.cpp
polly/trunk/test/ScopInfo/delinearize-together-all-data-refs.ll
polly/trunk/test/ScopInfo/invariant_load_ptr_ptr_noalias.ll
polly/trunk/test/ScopInfo/multidim_only_ivs_3d_cast.ll
polly/trunk/test/ScopInfo/non_affine_region_4.ll
polly/trunk/test/ScopInfo/read-only-scalars.ll
polly/trunk/test/ScopInfo/same-base-address-scalar-and-array.ll
polly/trunk/test/ScopInfo/scalar.ll
polly/trunk/test/ScopInfo/simple_loop_1.ll
Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=252602&r1=252601&r2=252602&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Tue Nov 10 08:02:54 2015
@@ -214,8 +214,10 @@ isl_id *ScopArrayInfo::getBasePtrId() co
void ScopArrayInfo::dump() const { print(errs()); }
void ScopArrayInfo::print(raw_ostream &OS, bool SizeAsPwAff) const {
- OS.indent(8) << *getElementType() << " " << getName() << "[*]";
- for (unsigned u = 0; u < getNumberOfDimensions(); u++) {
+ OS.indent(8) << *getElementType() << " " << getName();
+ if (getNumberOfDimensions() > 0)
+ OS << "[*]";
+ for (unsigned u = 0; u + 1 < getNumberOfDimensions(); u++) {
OS << "[";
if (SizeAsPwAff)
@@ -226,6 +228,8 @@ void ScopArrayInfo::print(raw_ostream &O
OS << "]";
}
+ OS << ";";
+
if (BasePtrOriginSAI)
OS << " [BasePtrOrigin: " << BasePtrOriginSAI->getName() << "]";
Modified: polly/trunk/test/ScopInfo/delinearize-together-all-data-refs.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/delinearize-together-all-data-refs.ll?rev=252602&r1=252601&r2=252602&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/delinearize-together-all-data-refs.ll (original)
+++ polly/trunk/test/ScopInfo/delinearize-together-all-data-refs.ll Tue Nov 10 08:02:54 2015
@@ -11,7 +11,7 @@
; CHECK: Arrays {
-; CHECK: double MemRef_A[*][%m][%o][8] // Element size 8
+; CHECK: double MemRef_A[*][%m][%o]; // Element size 8
; CHECK: }
; CHECK: [m, o, n] -> { Stmt_for_body6[i0, i1, i2] -> MemRef_A[3 + i0, i1, 7 + i2] };
Modified: polly/trunk/test/ScopInfo/invariant_load_ptr_ptr_noalias.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/invariant_load_ptr_ptr_noalias.ll?rev=252602&r1=252601&r2=252602&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/invariant_load_ptr_ptr_noalias.ll (original)
+++ polly/trunk/test/ScopInfo/invariant_load_ptr_ptr_noalias.ll Tue Nov 10 08:02:54 2015
@@ -13,15 +13,15 @@
; CHECK: }
;
; CHECK: Arrays {
-; CHECK: i32** MemRef_A[*][8]
-; CHECK: i32* MemRef_tmp3[*][8] [BasePtrOrigin: MemRef_A]
-; CHECK: i32 MemRef_tmp5[*][4] [BasePtrOrigin: MemRef_tmp3]
+; CHECK: i32** MemRef_A[*];
+; CHECK: i32* MemRef_tmp3[*]; [BasePtrOrigin: MemRef_A]
+; CHECK: i32 MemRef_tmp5[*]; [BasePtrOrigin: MemRef_tmp3]
; CHECK: }
;
; CHECK: Arrays (Bounds as pw_affs) {
-; CHECK: i32** MemRef_A[*][ { [] -> [(8)] } ]
-; CHECK: i32* MemRef_tmp3[*][ { [] -> [(8)] } ] [BasePtrOrigin: MemRef_A]
-; CHECK: i32 MemRef_tmp5[*][ { [] -> [(4)] } ] [BasePtrOrigin: MemRef_tmp3]
+; CHECK: i32** MemRef_A[*];
+; CHECK: i32* MemRef_tmp3[*]; [BasePtrOrigin: MemRef_A]
+; CHECK: i32 MemRef_tmp5[*]; [BasePtrOrigin: MemRef_tmp3]
; CHECK: }
;
; void f(int ***A) {
Modified: polly/trunk/test/ScopInfo/multidim_only_ivs_3d_cast.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/multidim_only_ivs_3d_cast.ll?rev=252602&r1=252601&r2=252602&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/multidim_only_ivs_3d_cast.ll (original)
+++ polly/trunk/test/ScopInfo/multidim_only_ivs_3d_cast.ll Tue Nov 10 08:02:54 2015
@@ -25,10 +25,10 @@
; CHECK-NOT: p5
; CHECK: Arrays {
-; CHECK: double MemRef_A[*][(zext i32 %m to i64)][(zext i32 %o to i64)][8] // Element size 8
+; CHECK: double MemRef_A[*][(zext i32 %m to i64)][(zext i32 %o to i64)]; // Element size 8
; CHECK: }
; CHECK: Arrays (Bounds as pw_affs) {
-; CHECK: double MemRef_A[*][ [p_3] -> { [] -> [(p_3)] } ][ [p_4] -> { [] -> [(p_4)] } ][ { [] -> [(8)] } ] // Element size 8
+; CHECK: double MemRef_A[*][ [p_3] -> { [] -> [(p_3)] } ][ [p_4] -> { [] -> [(p_4)] } ]; // Element size 8
; CHECK: }
Modified: polly/trunk/test/ScopInfo/non_affine_region_4.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/non_affine_region_4.ll?rev=252602&r1=252601&r2=252602&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/non_affine_region_4.ll (original)
+++ polly/trunk/test/ScopInfo/non_affine_region_4.ll Tue Nov 10 08:02:54 2015
@@ -15,15 +15,15 @@
; CHECK: Region: %bb1---%bb11
;
; CHECK: Arrays {
-; CHECK: i32 MemRef_A[*][4]
-; CHECK: i32 MemRef_x[*] [BasePtrOrigin: MemRef_A]
-; CHECK: i32 MemRef_y__phi[*]
+; CHECK: i32 MemRef_A[*];
+; CHECK: i32 MemRef_x; [BasePtrOrigin: MemRef_A]
+; CHECK: i32 MemRef_y__phi;
; CHECK: }
;
; CHECK: Arrays (Bounds as pw_affs) {
-; CHECK: i32 MemRef_A[*][ { [] -> [(4)] } ]
-; CHECK: i32 MemRef_x[*] [BasePtrOrigin: MemRef_A]
-; CHECK: i32 MemRef_y__phi[*]
+; CHECK: i32 MemRef_A[*];
+; CHECK: i32 MemRef_x; [BasePtrOrigin: MemRef_A]
+; CHECK: i32 MemRef_y__phi;
; CHECK: }
;
; CHECK: Stmt_bb2__TO__bb7
Modified: polly/trunk/test/ScopInfo/read-only-scalars.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/read-only-scalars.ll?rev=252602&r1=252601&r2=252602&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/read-only-scalars.ll (original)
+++ polly/trunk/test/ScopInfo/read-only-scalars.ll Tue Nov 10 08:02:54 2015
@@ -6,7 +6,7 @@
; CHECK-NOT: Memref_scalar
-; SCALARS: float MemRef_scalar[*] // Element size 4
+; SCALARS: float MemRef_scalar; // Element size 4
; SCALARS: ReadAccess := [Reduction Type: NONE] [Scalar: 1]
; SCALARS: { Stmt_stmt1[i0] -> MemRef_scalar[] };
Modified: polly/trunk/test/ScopInfo/same-base-address-scalar-and-array.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/same-base-address-scalar-and-array.ll?rev=252602&r1=252601&r2=252602&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/same-base-address-scalar-and-array.ll (original)
+++ polly/trunk/test/ScopInfo/same-base-address-scalar-and-array.ll Tue Nov 10 08:02:54 2015
@@ -4,9 +4,9 @@
; as it is used as a memory base pointer (%0) but also as a scalar (%out.addr.0.lcssa).
;
; CHECK: Arrays {
-; CHECK-NEXT: float* MemRef_out[*] // Element size 0
-; CHECK-NEXT: float* MemRef_out_addr_0_lcssa[*] // Element size 0
-; CHECK-NEXT: float MemRef_out[*][4] // Element size 4
+; CHECK-NEXT: float* MemRef_out; // Element size 0
+; CHECK-NEXT: float* MemRef_out_addr_0_lcssa; // Element size 0
+; CHECK-NEXT: float MemRef_out[*]; // Element size 4
; CHECK-NEXT: }
;
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
Modified: polly/trunk/test/ScopInfo/scalar.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/scalar.ll?rev=252602&r1=252601&r2=252602&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/scalar.ll (original)
+++ polly/trunk/test/ScopInfo/scalar.ll Tue Nov 10 08:02:54 2015
@@ -30,13 +30,13 @@ return:
}
; CHECK: Arrays {
-; CHECK: i64 MemRef_a[*][8]
-; CHECK: i64 MemRef_val[*] [BasePtrOrigin: MemRef_a]
+; CHECK: i64 MemRef_a[*];
+; CHECK: i64 MemRef_val; [BasePtrOrigin: MemRef_a]
; CHECK: }
;
; CHECK: Arrays (Bounds as pw_affs) {
-; CHECK: i64 MemRef_a[*][ { [] -> [(8)] } ]
-; CHECK: i64 MemRef_val[*] [BasePtrOrigin: MemRef_a]
+; CHECK: i64 MemRef_a[*];
+; CHECK: i64 MemRef_val; [BasePtrOrigin: MemRef_a]
; CHECK: }
; CHECK: Stmt_S1
Modified: polly/trunk/test/ScopInfo/simple_loop_1.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/simple_loop_1.ll?rev=252602&r1=252601&r2=252602&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/simple_loop_1.ll (original)
+++ polly/trunk/test/ScopInfo/simple_loop_1.ll Tue Nov 10 08:02:54 2015
@@ -27,7 +27,7 @@ return:
; CHECK: Assumed Context:
; CHECK: { : }
; CHECK: Arrays {
-; CHECK: i64 MemRef_a[*][8] // Element size 8
+; CHECK: i64 MemRef_a[*]; // Element size 8
; CHECK: }
; CHECK: Stmt_bb
More information about the llvm-commits
mailing list