diff options
| author | Adam Nemet <anemet@apple.com> | 2016-06-16 16:45:29 +0000 |
|---|---|---|
| committer | Adam Nemet <anemet@apple.com> | 2016-06-16 16:45:29 +0000 |
| commit | 776346848ac4d5aab237f1b5ed914d64d4574876 (patch) | |
| tree | dfca13506bf9b7bcb69ef6357724f03005a4d973 | |
| parent | f9d5620029f6fb7f501f515e85d6dc0cb6f50eb0 (diff) | |
| download | bcm5719-llvm-776346848ac4d5aab237f1b5ed914d64d4574876.tar.gz bcm5719-llvm-776346848ac4d5aab237f1b5ed914d64d4574876.zip | |
[LLE] New test to check that no versioning for symbolic strides occurs. NFC
This is currently only performed in the Vectorizer. I will change this
as symbolic stride collection is moved to LAA.
This test will track when the actual functional change occurs.
llvm-svn: 272918
| -rw-r--r-- | llvm/test/Transforms/LoopLoadElim/symbolic-stride.ll | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/llvm/test/Transforms/LoopLoadElim/symbolic-stride.ll b/llvm/test/Transforms/LoopLoadElim/symbolic-stride.ll new file mode 100644 index 00000000000..a0fc7e6749e --- /dev/null +++ b/llvm/test/Transforms/LoopLoadElim/symbolic-stride.ll @@ -0,0 +1,35 @@ +; RUN: opt -loop-load-elim -S < %s | FileCheck %s -check-prefix=CHECK + +; Forwarding in the presence of symbolic strides is currently not supported: +; +; for (unsigned i = 0; i < 100; i++) +; A[i + 1] = A[Stride * i] + B[i]; + +target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" + +; CHECK-LABEL: @f( +define void @f(i32* noalias nocapture %A, i32* noalias nocapture readonly %B, i64 %N, + i64 %stride) { +entry: +; CHECK-NOT: %load_initial = load i32, i32* %A + br label %for.body + +for.body: ; preds = %for.body, %entry +; CHECK-NOT: %store_forwarded = phi i32 [ %load_initial, %entry ], [ %add, %for.body ] + %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] + %mul = mul i64 %indvars.iv, %stride + %arrayidx = getelementptr inbounds i32, i32* %A, i64 %mul + %load = load i32, i32* %arrayidx, align 4 + %arrayidx2 = getelementptr inbounds i32, i32* %B, i64 %indvars.iv + %load_1 = load i32, i32* %arrayidx2, align 4 +; CHECK-NOT: %add = add i32 %load_1, %store_forwarded + %add = add i32 %load_1, %load + %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 + %arrayidx_next = getelementptr inbounds i32, i32* %A, i64 %indvars.iv.next + store i32 %add, i32* %arrayidx_next, align 4 + %exitcond = icmp eq i64 %indvars.iv.next, %N + br i1 %exitcond, label %for.end, label %for.body + +for.end: ; preds = %for.body + ret void +} |

