[llvm-commits] [polly] r144641 - in /polly/trunk: lib/Analysis/ScopInfo.cpp test/CodeGen/loop_with_condition_2.ll test/CodeGen/single_loop_param.ll test/ScheduleOptimizer/2011-08-25-crash_in_vectorizer.ll test/ScopInfo/20111108-Parameter-not-detected.ll test/ScopInfo/loop_carry.ll
Tobias Grosser
grosser at fim.uni-passau.de
Tue Nov 15 03:38:55 PST 2011
Author: grosser
Date: Tue Nov 15 05:38:55 2011
New Revision: 144641
URL: http://llvm.org/viewvc/llvm-project?rev=144641&view=rev
Log:
ScopInfo: Use names of simple parameters to name the isl parameter dimensions.
Parameters can be complex SCEV expressions, but they can also be single scalar
values. If a parameters is such a simple scalar value and the value is named,
use this name to name the isl parameter dimensions.
Modified:
polly/trunk/lib/Analysis/ScopInfo.cpp
polly/trunk/test/CodeGen/loop_with_condition_2.ll
polly/trunk/test/CodeGen/single_loop_param.ll
polly/trunk/test/ScheduleOptimizer/2011-08-25-crash_in_vectorizer.ll
polly/trunk/test/ScopInfo/20111108-Parameter-not-detected.ll
polly/trunk/test/ScopInfo/loop_carry.ll
Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=144641&r1=144640&r2=144641&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Tue Nov 15 05:38:55 2011
@@ -870,7 +870,16 @@
if (IdIter == ParameterIds.end())
return NULL;
- std::string ParameterName = "p" + convertInt(IdIter->second);
+ std::string ParameterName;
+
+ if (const SCEVUnknown *ValueParameter = dyn_cast<SCEVUnknown>(Parameter)) {
+ Value *Val = ValueParameter->getValue();
+ ParameterName = Val->getNameStr();
+ }
+
+ if (ParameterName == "" || ParameterName.substr(0, 2) == "p_")
+ ParameterName = "p_" + convertInt(IdIter->second);
+
return isl_id_alloc(getIslCtx(), ParameterName.c_str(), (void *) Parameter);
}
Modified: polly/trunk/test/CodeGen/loop_with_condition_2.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/CodeGen/loop_with_condition_2.ll?rev=144641&r1=144640&r2=144641&view=diff
==============================================================================
--- polly/trunk/test/CodeGen/loop_with_condition_2.ll (original)
+++ polly/trunk/test/CodeGen/loop_with_condition_2.ll Tue Nov 15 05:38:55 2011
@@ -132,11 +132,11 @@
declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind
-; CHECK: for (c2=0;c2<=min(1023,M+1024);c2++) {
+; CHECK: for (c2=0;c2<=min(1023,m+1024);c2++) {
; CHECK: Stmt_if_then(c2);
; CHECK: Stmt_if_end(c2);
; CHECK: }
-; CHECK: for (c2=max(0,M+1025);c2<=1023;c2++) {
+; CHECK: for (c2=max(0,m+1025);c2<=1023;c2++) {
; CHECK: Stmt_if_else(c2);
; CHECK: Stmt_if_end(c2);
; CHECK: }
Modified: polly/trunk/test/CodeGen/single_loop_param.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/CodeGen/single_loop_param.ll?rev=144641&r1=144640&r2=144641&view=diff
==============================================================================
--- polly/trunk/test/CodeGen/single_loop_param.ll (original)
+++ polly/trunk/test/CodeGen/single_loop_param.ll Tue Nov 15 05:38:55 2011
@@ -70,8 +70,8 @@
declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind
-; CHECK: if (M >= 1) {
-; CHECK: for (c2=0;c2<=M-1;c2++) {
+; CHECK: if (n >= 1) {
+; CHECK: for (c2=0;c2<=n-1;c2++) {
; CHECK: Stmt_bb2(c2);
; CHECK: }
; CHECK: }
Modified: polly/trunk/test/ScheduleOptimizer/2011-08-25-crash_in_vectorizer.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScheduleOptimizer/2011-08-25-crash_in_vectorizer.ll?rev=144641&r1=144640&r2=144641&view=diff
==============================================================================
--- polly/trunk/test/ScheduleOptimizer/2011-08-25-crash_in_vectorizer.ll (original)
+++ polly/trunk/test/ScheduleOptimizer/2011-08-25-crash_in_vectorizer.ll Tue Nov 15 05:38:55 2011
@@ -29,18 +29,18 @@
ret void
}
-; CHECK: if (M >= 1) {
-; CHECK: for (c1=0;c1<=M-1;c1+=32) {
-; CHECK: for (c2=c1;c2<=min(M-1,c1+31);c2++) {
+; CHECK: if (p_0 >= 1) {
+; CHECK: for (c1=0;c1<=p_0-1;c1+=32) {
+; CHECK: for (c2=c1;c2<=min(c1+31,p_0-1);c2++) {
; CHECK: Stmt_bb2(c2);
; CHECK: }
; CHECK: }
; CHECK: }
-; VECTOR: if (M >= 1) {
-; VECTOR: for (c1=0;c1<=M-1;c1+=32) {
-; VECTOR: for (c2=-4*floord(-c1,4);c2<=min(M-1,c1+31);c2+=4) {
-; VECTOR: for (c3=c2;c3<=min(M-1,c2+3);c3++) {
+; VECTOR: if (p_0 >= 1) {
+; VECTOR: for (c1=0;c1<=p_0-1;c1+=32) {
+; VECTOR: for (c2=-4*floord(-c1,4);c2<=min(c1+31,p_0-1);c2+=4) {
+; VECTOR: for (c3=c2;c3<=min(c2+3,p_0-1);c3++) {
; VECTOR: Stmt_bb2(c3);
; VECTOR: }
; VECTOR: }
Modified: polly/trunk/test/ScopInfo/20111108-Parameter-not-detected.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/20111108-Parameter-not-detected.ll?rev=144641&r1=144640&r2=144641&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/20111108-Parameter-not-detected.ll (original)
+++ polly/trunk/test/ScopInfo/20111108-Parameter-not-detected.ll Tue Nov 15 05:38:55 2011
@@ -52,5 +52,5 @@
}
; CHECK: Domain :=
-; CHECK: [p0] -> { Stmt_if_then[i0] : i0 >= 0 and i0 <= 1022 and i0 >= 1001 - p0 };
+; CHECK: [p_0] -> { Stmt_if_then[i0] : i0 >= 0 and i0 <= 1022 and i0 >= 1001 - p_0 };
Modified: polly/trunk/test/ScopInfo/loop_carry.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/loop_carry.ll?rev=144641&r1=144640&r2=144641&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/loop_carry.ll (original)
+++ polly/trunk/test/ScopInfo/loop_carry.ll Tue Nov 15 05:38:55 2011
@@ -47,46 +47,46 @@
}
; CHECK: Context:
-; CHECK: [p0] -> { : }
+; CHECK: [n] -> { : }
; CHECK: Statements {
; CHECK: Stmt_bb_nph
; CHECK: Domain :=
-; CHECK: [p0] -> { Stmt_bb_nph[] : p0 >= 2 };
+; CHECK: [n] -> { Stmt_bb_nph[] : n >= 2 };
; CHECK: Scattering :=
-; CHECK: [p0] -> { Stmt_bb_nph[] -> scattering[0, 0, 0] };
+; CHECK: [n] -> { Stmt_bb_nph[] -> scattering[0, 0, 0] };
; CHECK: ReadAccess :=
-; CHECK: [p0] -> { Stmt_bb_nph[] -> MemRef_a[0] };
+; CHECK: [n] -> { Stmt_bb_nph[] -> MemRef_a[0] };
; CHECK: WriteAccess :=
-; CHECK: [p0] -> { Stmt_bb_nph[] -> MemRef_k_05_reg2mem[0] };
+; CHECK: [n] -> { Stmt_bb_nph[] -> MemRef_k_05_reg2mem[0] };
; CHECK: WriteAccess :=
-; CHECK: [p0] -> { Stmt_bb_nph[] -> MemRef__reg2mem[0] };
+; CHECK: [n] -> { Stmt_bb_nph[] -> MemRef__reg2mem[0] };
; CHECK: Stmt_bb
; CHECK: Domain :=
-; CHECK: [p0] -> { Stmt_bb[i0] : i0 >= 0 and i0 <= -2 + p0 and p0 >= 2 };
+; CHECK: [n] -> { Stmt_bb[i0] : i0 >= 0 and i0 <= -2 + n and n >= 2 };
; CHECK: Scattering :=
-; CHECK: [p0] -> { Stmt_bb[i0] -> scattering[1, i0, 0] };
+; CHECK: [n] -> { Stmt_bb[i0] -> scattering[1, i0, 0] };
; CHECK: ReadAccess :=
-; CHECK: [p0] -> { Stmt_bb[i0] -> MemRef__reg2mem[0] };
+; CHECK: [n] -> { Stmt_bb[i0] -> MemRef__reg2mem[0] };
; CHECK: ReadAccess :=
-; CHECK: [p0] -> { Stmt_bb[i0] -> MemRef_k_05_reg2mem[0] };
+; CHECK: [n] -> { Stmt_bb[i0] -> MemRef_k_05_reg2mem[0] };
; CHECK: WriteAccess :=
-; CHECK: [p0] -> { Stmt_bb[i0] -> MemRef_a[1 + i0] };
+; CHECK: [n] -> { Stmt_bb[i0] -> MemRef_a[1 + i0] };
; CHECK: ReadAccess :=
-; CHECK: [p0] -> { Stmt_bb[i0] -> MemRef_a[2 + 2i0] };
+; CHECK: [n] -> { Stmt_bb[i0] -> MemRef_a[2 + 2i0] };
; CHECK: ReadAccess :=
-; CHECK: [p0] -> { Stmt_bb[i0] -> MemRef_a[4 + i0] };
+; CHECK: [n] -> { Stmt_bb[i0] -> MemRef_a[4 + i0] };
; CHECK: WriteAccess :=
-; CHECK: [p0] -> { Stmt_bb[i0] -> MemRef_k_05_reg2mem[0] };
+; CHECK: [n] -> { Stmt_bb[i0] -> MemRef_k_05_reg2mem[0] };
; CHECK: WriteAccess :=
-; CHECK: [p0] -> { Stmt_bb[i0] -> MemRef__reg2mem[0] };
+; CHECK: [n] -> { Stmt_bb[i0] -> MemRef__reg2mem[0] };
; CHECK: FinalRead
; CHECK: Domain :=
-; CHECK: [p0] -> { FinalRead[0] };
+; CHECK: [n] -> { FinalRead[0] };
; CHECK: Scattering :=
-; CHECK: [p0] -> { FinalRead[i0] -> scattering[200000000, o1, o2] };
+; CHECK: [n] -> { FinalRead[i0] -> scattering[200000000, o1, o2] };
; CHECK: ReadAccess :=
-; CHECK: [p0] -> { FinalRead[i0] -> MemRef_a[o0] };
+; CHECK: [n] -> { FinalRead[i0] -> MemRef_a[o0] };
; CHECK: ReadAccess :=
-; CHECK: [p0] -> { FinalRead[i0] -> MemRef_k_05_reg2mem[o0] };
+; CHECK: [n] -> { FinalRead[i0] -> MemRef_k_05_reg2mem[o0] };
; CHECK: ReadAccess :=
; CHECK: -> { FinalRead[i0] -> MemRef__reg2mem[o0] };
More information about the llvm-commits
mailing list