mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-21 21:29:41 +00:00
More tests to global struct vectorizer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175898 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
45b2c25efb
commit
fd4af7d334
@ -55,6 +55,102 @@ for.end: ; preds = %for.cond
|
||||
ret i32 %7
|
||||
}
|
||||
|
||||
; int noAlias02 (int a) {
|
||||
; int i;
|
||||
; for (i=0; i<SIZE-10; i++)
|
||||
; Foo.A[i] = Foo.B[i+10] + a;
|
||||
; return Foo.A[a];
|
||||
; }
|
||||
; CHECK: define i32 @noAlias02
|
||||
; CHECK: add nsw <4 x i32>
|
||||
; CHECK ret
|
||||
|
||||
define i32 @noAlias02(i32 %a) {
|
||||
entry:
|
||||
%a.addr = alloca i32, align 4
|
||||
%i = alloca i32, align 4
|
||||
store i32 %a, i32* %a.addr, align 4
|
||||
store i32 0, i32* %i, align 4
|
||||
br label %for.cond
|
||||
|
||||
for.cond: ; preds = %for.inc, %entry
|
||||
%0 = load i32* %i, align 4
|
||||
%cmp = icmp slt i32 %0, 90
|
||||
br i1 %cmp, label %for.body, label %for.end
|
||||
|
||||
for.body: ; preds = %for.cond
|
||||
%1 = load i32* %i, align 4
|
||||
%add = add nsw i32 %1, 10
|
||||
%arrayidx = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 2), i32 0, i32 %add
|
||||
%2 = load i32* %arrayidx, align 4
|
||||
%3 = load i32* %a.addr, align 4
|
||||
%add1 = add nsw i32 %2, %3
|
||||
%4 = load i32* %i, align 4
|
||||
%arrayidx2 = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %4
|
||||
store i32 %add1, i32* %arrayidx2, align 4
|
||||
br label %for.inc
|
||||
|
||||
for.inc: ; preds = %for.body
|
||||
%5 = load i32* %i, align 4
|
||||
%inc = add nsw i32 %5, 1
|
||||
store i32 %inc, i32* %i, align 4
|
||||
br label %for.cond
|
||||
|
||||
for.end: ; preds = %for.cond
|
||||
%6 = load i32* %a.addr, align 4
|
||||
%arrayidx3 = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %6
|
||||
%7 = load i32* %arrayidx3, align 4
|
||||
ret i32 %7
|
||||
}
|
||||
|
||||
; int noAlias03 (int a) {
|
||||
; int i;
|
||||
; for (i=0; i<SIZE; i++)
|
||||
; Foo.A[i+10] = Foo.B[i] + a;
|
||||
; return Foo.A[a];
|
||||
; }
|
||||
; CHECK: define i32 @noAlias03
|
||||
; CHECK: add nsw <4 x i32>
|
||||
; CHECK ret
|
||||
|
||||
define i32 @noAlias03(i32 %a) {
|
||||
entry:
|
||||
%a.addr = alloca i32, align 4
|
||||
%i = alloca i32, align 4
|
||||
store i32 %a, i32* %a.addr, align 4
|
||||
store i32 0, i32* %i, align 4
|
||||
br label %for.cond
|
||||
|
||||
for.cond: ; preds = %for.inc, %entry
|
||||
%0 = load i32* %i, align 4
|
||||
%cmp = icmp slt i32 %0, 100
|
||||
br i1 %cmp, label %for.body, label %for.end
|
||||
|
||||
for.body: ; preds = %for.cond
|
||||
%1 = load i32* %i, align 4
|
||||
%arrayidx = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 2), i32 0, i32 %1
|
||||
%2 = load i32* %arrayidx, align 4
|
||||
%3 = load i32* %a.addr, align 4
|
||||
%add = add nsw i32 %2, %3
|
||||
%4 = load i32* %i, align 4
|
||||
%add1 = add nsw i32 %4, 10
|
||||
%arrayidx2 = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %add1
|
||||
store i32 %add, i32* %arrayidx2, align 4
|
||||
br label %for.inc
|
||||
|
||||
for.inc: ; preds = %for.body
|
||||
%5 = load i32* %i, align 4
|
||||
%inc = add nsw i32 %5, 1
|
||||
store i32 %inc, i32* %i, align 4
|
||||
br label %for.cond
|
||||
|
||||
for.end: ; preds = %for.cond
|
||||
%6 = load i32* %a.addr, align 4
|
||||
%arrayidx3 = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %6
|
||||
%7 = load i32* %arrayidx3, align 4
|
||||
ret i32 %7
|
||||
}
|
||||
|
||||
; int mayAlias01 (int a) {
|
||||
; int i;
|
||||
; for (i=0; i<SIZE; i++)
|
||||
@ -104,6 +200,56 @@ for.end: ; preds = %for.cond
|
||||
ret i32 %7
|
||||
}
|
||||
|
||||
; int mayAlias04 (int a) {
|
||||
; int i;
|
||||
; for (i=0; i<SIZE; i++)
|
||||
; *(PA+i) = *(PB+i) + a;
|
||||
; return Foo.A[a];
|
||||
; }
|
||||
; CHECK: define i32 @mayAlias04
|
||||
; CHECK-NOT: add nsw <4 x i32>
|
||||
; CHECK ret
|
||||
|
||||
define i32 @mayAlias04(i32 %a) {
|
||||
entry:
|
||||
%a.addr = alloca i32, align 4
|
||||
%i = alloca i32, align 4
|
||||
store i32 %a, i32* %a.addr, align 4
|
||||
store i32 0, i32* %i, align 4
|
||||
br label %for.cond
|
||||
|
||||
for.cond: ; preds = %for.inc, %entry
|
||||
%0 = load i32* %i, align 4
|
||||
%cmp = icmp slt i32 %0, 100
|
||||
br i1 %cmp, label %for.body, label %for.end
|
||||
|
||||
for.body: ; preds = %for.cond
|
||||
%1 = load i32** @PB, align 4
|
||||
%2 = load i32* %i, align 4
|
||||
%add.ptr = getelementptr inbounds i32* %1, i32 %2
|
||||
%3 = load i32* %add.ptr, align 4
|
||||
%4 = load i32* %a.addr, align 4
|
||||
%add = add nsw i32 %3, %4
|
||||
%5 = load i32** @PA, align 4
|
||||
%6 = load i32* %i, align 4
|
||||
%add.ptr1 = getelementptr inbounds i32* %5, i32 %6
|
||||
store i32 %add, i32* %add.ptr1, align 4
|
||||
br label %for.inc
|
||||
|
||||
for.inc: ; preds = %for.body
|
||||
%7 = load i32* %i, align 4
|
||||
%inc = add nsw i32 %7, 1
|
||||
store i32 %inc, i32* %i, align 4
|
||||
br label %for.cond
|
||||
|
||||
for.end: ; preds = %for.cond
|
||||
%8 = load i32** @PA, align 4
|
||||
%9 = load i32* %a.addr, align 4
|
||||
%add.ptr2 = getelementptr inbounds i32* %8, i32 %9
|
||||
%10 = load i32* %add.ptr2, align 4
|
||||
ret i32 %10
|
||||
}
|
||||
|
||||
; int mayAlias02 (int a) {
|
||||
; int i;
|
||||
; for (i=0; i<SIZE; i++)
|
||||
|
Loading…
x
Reference in New Issue
Block a user