diff options
| author | Tobias Grosser <tobias@grosser.es> | 2015-06-23 20:55:05 +0000 |
|---|---|---|
| committer | Tobias Grosser <tobias@grosser.es> | 2015-06-23 20:55:05 +0000 |
| commit | a6085698561e983ed9cc891cf459b95e90a00217 (patch) | |
| tree | 8838a7beb869c7038cfc9153af398d8bf66a60c2 | |
| parent | 6ca162e6e016bd50fb946daf17d05a5047a7f7e7 (diff) | |
| download | bcm5719-llvm-a6085698561e983ed9cc891cf459b95e90a00217.tar.gz bcm5719-llvm-a6085698561e983ed9cc891cf459b95e90a00217.zip | |
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.
llvm-svn: 240458
| -rw-r--r-- | polly/test/DeadCodeElimination/non-affine-affine-mix.ll | 10 | ||||
| -rw-r--r-- | polly/test/DeadCodeElimination/non-affine.ll | 9 |
2 files changed, 13 insertions, 6 deletions
diff --git a/polly/test/DeadCodeElimination/non-affine-affine-mix.ll b/polly/test/DeadCodeElimination/non-affine-affine-mix.ll index 1b3f38bcf41..b88aff1809a 100644 --- a/polly/test/DeadCodeElimination/non-affine-affine-mix.ll +++ b/polly/test/DeadCodeElimination/non-affine-affine-mix.ll @@ -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 } + diff --git a/polly/test/DeadCodeElimination/non-affine.ll b/polly/test/DeadCodeElimination/non-affine.ll index 33b7ccc9550..8505ea567e7 100644 --- a/polly/test/DeadCodeElimination/non-affine.ll +++ b/polly/test/DeadCodeElimination/non-affine.ll @@ -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: ; preds = %for.inc, %entry 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: ; preds = %for.cond ret void } +attributes #1 = { nounwind readnone } |

