[polly] r177567 - ScopDetect: Add test cases for non-simple regions
Tobias Grosser
grosser at fim.uni-passau.de
Wed Mar 20 13:02:35 PDT 2013
Author: grosser
Date: Wed Mar 20 15:02:35 2013
New Revision: 177567
URL: http://llvm.org/viewvc/llvm-project?rev=177567&view=rev
Log:
ScopDetect: Add test cases for non-simple regions
Added:
polly/trunk/test/ScopDetect/simple_loop_non_single_entry.ll
polly/trunk/test/ScopDetect/simple_loop_non_single_exit.ll
polly/trunk/test/ScopDetect/simple_loop_non_single_exit_2.ll
Added: polly/trunk/test/ScopDetect/simple_loop_non_single_entry.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopDetect/simple_loop_non_single_entry.ll?rev=177567&view=auto
==============================================================================
--- polly/trunk/test/ScopDetect/simple_loop_non_single_entry.ll (added)
+++ polly/trunk/test/ScopDetect/simple_loop_non_single_entry.ll Wed Mar 20 15:02:35 2013
@@ -0,0 +1,45 @@
+; RUN: opt %loadPolly -polly-detect -analyze < %s | FileCheck %s
+; RUN: opt %loadPolly -polly-region-simplify -polly-detect -analyze < %s | FileCheck %s -check-prefix=CHECK-SIMPLIFY
+
+; void f(long A[], long N) {
+; long i;
+;
+; if (true)
+; goto loop;
+; else
+; goto loop;
+;
+; loop:
+; for (i = 0; i < N; ++i)
+; A[i] = i;
+; }
+
+target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
+target triple = "x86_64-unknown-linux-gnu"
+
+define void @f(i64* %A, i64 %N) nounwind {
+entry:
+ fence seq_cst
+ br i1 true, label %then, label %else
+
+then:
+ br label %for.i
+
+else:
+ br label %for.i
+
+for.i:
+ %indvar = phi i64 [ 0, %then ], [ 0, %else], [ %indvar.next, %for.i ]
+ %scevgep = getelementptr i64* %A, i64 %indvar
+ store i64 %indvar, i64* %scevgep
+ %indvar.next = add nsw i64 %indvar, 1
+ %exitcond = icmp eq i64 %indvar.next, %N
+ br i1 %exitcond, label %return, label %for.i
+
+return:
+ fence seq_cst
+ ret void
+}
+
+; CHECK-NOT: Valid Region for Scop
+; CHECK-SIMPLIFY: Valid Region for Scop: for.i => return
Added: polly/trunk/test/ScopDetect/simple_loop_non_single_exit.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopDetect/simple_loop_non_single_exit.ll?rev=177567&view=auto
==============================================================================
--- polly/trunk/test/ScopDetect/simple_loop_non_single_exit.ll (added)
+++ polly/trunk/test/ScopDetect/simple_loop_non_single_exit.ll Wed Mar 20 15:02:35 2013
@@ -0,0 +1,36 @@
+; RUN: opt %loadPolly -polly-detect -analyze < %s | FileCheck %s
+; RUN: opt %loadPolly -polly-region-simplify -polly-detect -analyze < %s | FileCheck %s -check-prefix=CHECK-SIMPLIFY
+
+; void f(long A[], long N) {
+; long i;
+; if (true)
+; for (i = 0; i < N; ++i)
+; A[i] = i;
+; }
+
+target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
+target triple = "x86_64-unknown-linux-gnu"
+
+define void @f(i64* %A, i64 %N) nounwind {
+entry:
+ fence seq_cst
+ br label %next
+
+next:
+ br i1 true, label %for.i, label %return
+
+for.i:
+ %indvar = phi i64 [ 0, %next], [ %indvar.next, %for.i ]
+ %scevgep = getelementptr i64* %A, i64 %indvar
+ store i64 %indvar, i64* %scevgep
+ %indvar.next = add nsw i64 %indvar, 1
+ %exitcond = icmp eq i64 %indvar.next, %N
+ br i1 %exitcond, label %return, label %for.i
+
+return:
+ fence seq_cst
+ ret void
+}
+
+; CHECK: Valid Region for Scop: for.i => return
+; CHECK-SIMPLIFY: Valid Region for Scop: next => return
Added: polly/trunk/test/ScopDetect/simple_loop_non_single_exit_2.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopDetect/simple_loop_non_single_exit_2.ll?rev=177567&view=auto
==============================================================================
--- polly/trunk/test/ScopDetect/simple_loop_non_single_exit_2.ll (added)
+++ polly/trunk/test/ScopDetect/simple_loop_non_single_exit_2.ll Wed Mar 20 15:02:35 2013
@@ -0,0 +1,37 @@
+; RUN: opt %loadPolly -polly-detect -analyze < %s | FileCheck %s
+; RUN: opt %loadPolly -polly-region-simplify -polly-detect -analyze < %s | FileCheck %s -check-prefix=CHECK-SIMPLIFY
+
+; void f(long A[], long N) {
+; long i;
+; if (true)
+; if (true)
+; for (i = 0; i < N; ++i)
+; A[i] = i;
+; }
+
+target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
+target triple = "x86_64-unknown-linux-gnu"
+
+define void @f(i64* %A, i64 %N) nounwind {
+entry:
+ fence seq_cst
+ br i1 true, label %next, label %return
+
+next:
+ br i1 true, label %for.i, label %return
+
+for.i:
+ %indvar = phi i64 [ 0, %next], [ %indvar.next, %for.i ]
+ %scevgep = getelementptr i64* %A, i64 %indvar
+ store i64 %indvar, i64* %scevgep
+ %indvar.next = add nsw i64 %indvar, 1
+ %exitcond = icmp eq i64 %indvar.next, %N
+ br i1 %exitcond, label %return, label %for.i
+
+return:
+ fence seq_cst
+ ret void
+}
+
+; CHECK: Valid Region for Scop: for.i => return
+; CHECK-SIMPLIFY: Valid Region for Scop: next => return.single_exit1
More information about the llvm-commits
mailing list