[polly] r240458 - Replace srem by function call in nonaffine test cases
Tobias Grosser
tobias at grosser.es
Tue Jun 23 13:55:05 PDT 2015
Author: grosser
Date: Tue Jun 23 15:55:05 2015
New Revision: 240458
URL: http://llvm.org/viewvc/llvm-project?rev=240458&view=rev
Log:
Replace srem by function call in nonaffine test cases
This makes the test cases nonaffine even if Polly some days gains support for
the srem instruction, an instruction which is currently not modeled but which
can clearly be modeled statically. A call to a function without definition
will always remain non-affine, as there is just insufficient static information
for it to be modeled more precisely.
Modified:
polly/trunk/test/DeadCodeElimination/non-affine-affine-mix.ll
polly/trunk/test/DeadCodeElimination/non-affine.ll
Modified: polly/trunk/test/DeadCodeElimination/non-affine-affine-mix.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/DeadCodeElimination/non-affine-affine-mix.ll?rev=240458&r1=240457&r2=240458&view=diff
==============================================================================
--- polly/trunk/test/DeadCodeElimination/non-affine-affine-mix.ll (original)
+++ polly/trunk/test/DeadCodeElimination/non-affine-affine-mix.ll Tue Jun 23 15:55:05 2015
@@ -2,7 +2,7 @@
;
; void f(int *A) {
; for (int i = 0; i < 1024; i++)
-; S1: A[i % 2] = i;
+; S1: A[bar(i)] = i;
; for (int i = 0; i < 1024; i++)
; S2: A[i2] = i;
; }
@@ -18,6 +18,8 @@
target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
+declare i32 @bar(i32) #1
+
define void @f(i32* %A) {
entry:
br label %for.cond
@@ -28,8 +30,8 @@ for.cond:
br i1 %exitcond, label %S1, label %next
S1:
- %rem = srem i32 %i.0, 2
- %arrayidx = getelementptr inbounds i32, i32* %A, i32 %rem
+ %nonaff = call i32 @bar(i32 %i.0)
+ %arrayidx = getelementptr inbounds i32, i32* %A, i32 %nonaff
store i32 %i.0, i32* %arrayidx, align 4
br label %for.inc
@@ -58,3 +60,5 @@ for.end:
ret void
}
+attributes #1 = { nounwind readnone }
+
Modified: polly/trunk/test/DeadCodeElimination/non-affine.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/DeadCodeElimination/non-affine.ll?rev=240458&r1=240457&r2=240458&view=diff
==============================================================================
--- polly/trunk/test/DeadCodeElimination/non-affine.ll (original)
+++ polly/trunk/test/DeadCodeElimination/non-affine.ll Tue Jun 23 15:55:05 2015
@@ -4,11 +4,13 @@
;
; void f(int *A) {
; for (int i = 0; i < 1024; i++)
-; A[i % 2] = i;
+; A[bar(i)] = i;
; }
;
target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
+declare i32 @bar(i32) #1
+
define void @f(i32* %A) {
entry:
br label %for.cond
@@ -19,8 +21,8 @@ for.cond:
br i1 %exitcond, label %for.body, label %for.end
for.body: ; preds = %for.cond
- %rem = srem i32 %i.0, 2
- %arrayidx = getelementptr inbounds i32, i32* %A, i32 %rem
+ %nonaff = call i32 @bar(i32 %i.0)
+ %arrayidx = getelementptr inbounds i32, i32* %A, i32 %nonaff
store i32 %i.0, i32* %arrayidx, align 4
br label %for.inc
@@ -32,3 +34,4 @@ for.end:
ret void
}
+attributes #1 = { nounwind readnone }
More information about the llvm-commits
mailing list