[polly] r248668 - Add test case from open bug

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 26 07:03:30 PDT 2015


Author: jdoerfert
Date: Sat Sep 26 09:03:29 2015
New Revision: 248668

URL: http://llvm.org/viewvc/llvm-project?rev=248668&view=rev
Log:
Add test case from open bug

  The bug (15771) was fixed already with the new domain generation
  but the test case was not added till now.


Added:
    polly/trunk/test/ScopInfo/isl_trip_count_03.ll

Added: polly/trunk/test/ScopInfo/isl_trip_count_03.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/isl_trip_count_03.ll?rev=248668&view=auto
==============================================================================
--- polly/trunk/test/ScopInfo/isl_trip_count_03.ll (added)
+++ polly/trunk/test/ScopInfo/isl_trip_count_03.ll Sat Sep 26 09:03:29 2015
@@ -0,0 +1,56 @@
+; RUN: opt %loadPolly -polly-detect-unprofitable -polly-scops -analyze < %s | FileCheck %s
+;
+; Test comes from a bug (15771) or better a feature request. It was not allowed
+; in Polly in the old domain generation as ScalarEvolution cannot figure out the
+; loop bounds. However, the new domain generation will detect the SCoP.
+;
+; CHECK:    Context:
+; CHECK:    [n] -> {  : n <= 2147483647 and n >= -2147483648 }
+; CHECK:    p0: %n
+; CHECK:    Statements {
+; CHECK:      Stmt_for_next
+; CHECK:            Domain :=
+; CHECK:                [n] -> { Stmt_for_next[i0] : i0 >= 0 and 2i0 <= -3 + n };
+; CHECK:            Schedule :=
+; CHECK:                [n] -> { Stmt_for_next[i0] -> [i0] };
+; CHECK:            ReadAccess := 
+; CHECK:                [n] -> { Stmt_for_next[i0] -> MemRef_A[i0] };
+; CHECK:            WriteAccess := 
+; CHECK:                [n] -> { Stmt_for_next[i0] -> MemRef_A[i0] };
+; CHECK:    }
+;
+ at A = common global [100 x i32] zeroinitializer, align 16
+
+define void @foo(i32 %n) #0 {
+entry:
+  br label %entry.split
+
+entry.split:                                      ; preds = %entry
+  %cmp2 = icmp sgt i32 %n, 0
+  br i1 %cmp2, label %for.body.lr.ph, label %for.end
+
+for.body.lr.ph:                                   ; preds = %entry.split
+  br label %for.body
+
+for.body:                                         ; preds = %for.body.lr.ph, %for.body
+  %indvar = phi i64 [ 0, %for.body.lr.ph ], [ %indvar.next, %for.next ]
+  %arrayidx = getelementptr [100 x i32], [100 x i32]* @A, i64 0, i64 %indvar
+  %0 = mul i64 %indvar, 2
+  %1 = add i64 %0, 2
+  %add1 = trunc i64 %1 to i32
+  %cmp = icmp slt i32 %add1, %n
+  %indvar.next = add i64 %indvar, 1
+  br i1 %cmp, label %for.next, label %for.cond.for.end_crit_edge
+
+for.next:
+  %2 = load i32, i32* %arrayidx, align 4
+  %add = add nsw i32 %2, 1
+  store i32 %add, i32* %arrayidx, align 4
+  br label %for.body
+
+for.cond.for.end_crit_edge:                       ; preds = %for.body
+  br label %for.end
+
+for.end:                                          ; preds = %for.cond.for.end_crit_edge, %entry.split
+  ret void
+}




More information about the llvm-commits mailing list