mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
[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
This commit is contained in:
parent
657964bdda
commit
e72e7a76eb
35
test/Transforms/LoopLoadElim/symbolic-stride.ll
Normal file
35
test/Transforms/LoopLoadElim/symbolic-stride.ll
Normal file
@ -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
|
||||
}
|
Loading…
Reference in New Issue
Block a user