forked from llir/testdata
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
llvm: update test cases to LLVM 10.0
Steps taken: 1. Update VER in testdata/llvm/Makefile from 9.0.0 to 10.0.0 2. Run `make` from testdata/llvm 3. Run `./skip.sh` from testdata/llvm 4. Run `git add .` from testdata/llvm This is just the first step to update the test cases to LLVM 10.0. A follow-up commit will update `*.ll.golden` test cases. And another follow-up commit will update the test cases of Coreutils and SQLite, which requires Clang 10.0 being installed on the system. Updates llir/llvm#132.
- Loading branch information
Showing
5,149 changed files
with
561,647 additions
and
147,823 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
; RUN: opt -basicaa -aa-eval -print-all-alias-modref-info %s 2>&1 | FileCheck %s | ||
|
||
; %col.ptr.1 and %col.ptr.2 do not alias, if we know that %skip >= 0, because | ||
; the distance between %col.ptr.1 and %col.ptr.2 is %skip + 6 and we load 6 | ||
; elements. | ||
define void @test1(double* %ptr, i32 %skip) { | ||
; CHECK-LABEL: Function: test1: 4 pointers, 1 call sites | ||
; CHECK-NEXT: MustAlias: <6 x double>* %col.ptr.1, double* %ptr | ||
; CHECK-NEXT: NoAlias: double* %col.ptr.2, double* %ptr | ||
; CHECK-NEXT: NoAlias: <6 x double>* %col.ptr.1, double* %col.ptr.2 | ||
; CHECK-NEXT: NoAlias: <6 x double>* %col.ptr.2.cast, double* %ptr | ||
; CHECK-NEXT: NoAlias: <6 x double>* %col.ptr.1, <6 x double>* %col.ptr.2.cast | ||
; CHECK-NEXT: MustAlias: <6 x double>* %col.ptr.2.cast, double* %col.ptr.2 | ||
; CHECK-NEXT: NoModRef: Ptr: double* %ptr <-> call void @llvm.assume(i1 %gt) | ||
; CHECK-NEXT: NoModRef: Ptr: <6 x double>* %col.ptr.1 <-> call void @llvm.assume(i1 %gt) | ||
; CHECK-NEXT: NoModRef: Ptr: double* %col.ptr.2 <-> call void @llvm.assume(i1 %gt) | ||
; CHECK-NEXT: NoModRef: Ptr: <6 x double>* %col.ptr.2.cast <-> call void @llvm.assume(i1 %gt) | ||
; | ||
%gt = icmp sgt i32 %skip, -1 | ||
call void @llvm.assume(i1 %gt) | ||
%stride = add nsw nuw i32 %skip, 6 | ||
%col.ptr.1 = bitcast double* %ptr to <6 x double>* | ||
%lv.1 = load <6 x double>, <6 x double>* %col.ptr.1, align 8 | ||
%col.ptr.2= getelementptr double, double* %ptr, i32 %stride | ||
%col.ptr.2.cast = bitcast double* %col.ptr.2 to <6 x double>* | ||
%lv.2 = load <6 x double>, <6 x double>* %col.ptr.2.cast, align 8 | ||
%res.1 = fadd <6 x double> %lv.1, %lv.1 | ||
%res.2 = fadd <6 x double> %lv.2, %lv.2 | ||
store <6 x double> %res.1, <6 x double>* %col.ptr.1, align 8 | ||
store <6 x double> %res.2, <6 x double>* %col.ptr.2.cast, align 8 | ||
ret void | ||
} | ||
|
||
; Same as @test1, but now we do not have an assume guaranteeing %skip >= 0. | ||
define void @test2(double* %ptr, i32 %skip) { | ||
; CHECK-LABEL: Function: test2: 4 pointers, 0 call sites | ||
; CHECK-NEXT: MustAlias: <6 x double>* %col.ptr.1, double* %ptr | ||
; CHECK-NEXT: MayAlias: double* %col.ptr.2, double* %ptr | ||
; CHECK-NEXT: MayAlias: <6 x double>* %col.ptr.1, double* %col.ptr.2 | ||
; CHECK-NEXT: MayAlias: <6 x double>* %col.ptr.2.cast, double* %ptr | ||
; CHECK-NEXT: MayAlias: <6 x double>* %col.ptr.1, <6 x double>* %col.ptr.2.cast | ||
; CHECK-NEXT: MustAlias: <6 x double>* %col.ptr.2.cast, double* %col.ptr.2 | ||
; | ||
%stride = add nsw nuw i32 %skip, 6 | ||
%col.ptr.1 = bitcast double* %ptr to <6 x double>* | ||
%lv.1 = load <6 x double>, <6 x double>* %col.ptr.1, align 8 | ||
%col.ptr.2= getelementptr double, double* %ptr, i32 %stride | ||
%col.ptr.2.cast = bitcast double* %col.ptr.2 to <6 x double>* | ||
%lv.2 = load <6 x double>, <6 x double>* %col.ptr.2.cast, align 8 | ||
%res.1 = fadd <6 x double> %lv.1, %lv.1 | ||
%res.2 = fadd <6 x double> %lv.2, %lv.2 | ||
store <6 x double> %res.1, <6 x double>* %col.ptr.1, align 8 | ||
store <6 x double> %res.2, <6 x double>* %col.ptr.2.cast, align 8 | ||
ret void | ||
} | ||
|
||
; Same as @test1, but the assume just guarantees %skip > -3, which is not | ||
; enough to derive NoAlias | ||
define void @test3(double* %ptr, i32 %skip) { | ||
; CHECK-LABEL: Function: test3: 4 pointers, 1 call sites | ||
; CHECK-NEXT: MustAlias: <6 x double>* %col.ptr.1, double* %ptr | ||
; CHECK-NEXT: MayAlias: double* %col.ptr.2, double* %ptr | ||
; CHECK-NEXT: MayAlias: <6 x double>* %col.ptr.1, double* %col.ptr.2 | ||
; CHECK-NEXT: MayAlias: <6 x double>* %col.ptr.2.cast, double* %ptr | ||
; CHECK-NEXT: MayAlias: <6 x double>* %col.ptr.1, <6 x double>* %col.ptr.2.cast | ||
; CHECK-NEXT: MustAlias: <6 x double>* %col.ptr.2.cast, double* %col.ptr.2 | ||
; CHECK-NEXT: NoModRef: Ptr: double* %ptr <-> call void @llvm.assume(i1 %gt) | ||
; CHECK-NEXT: NoModRef: Ptr: <6 x double>* %col.ptr.1 <-> call void @llvm.assume(i1 %gt) | ||
; CHECK-NEXT: NoModRef: Ptr: double* %col.ptr.2 <-> call void @llvm.assume(i1 %gt) | ||
; CHECK-NEXT: NoModRef: Ptr: <6 x double>* %col.ptr.2.cast <-> call void @llvm.assume(i1 %gt) | ||
; | ||
%gt = icmp sgt i32 %skip, -3 | ||
call void @llvm.assume(i1 %gt) | ||
%stride = add nsw nuw i32 %skip, 6 | ||
%col.ptr.1 = bitcast double* %ptr to <6 x double>* | ||
%lv.1 = load <6 x double>, <6 x double>* %col.ptr.1, align 8 | ||
%col.ptr.2= getelementptr double, double* %ptr, i32 %stride | ||
%col.ptr.2.cast = bitcast double* %col.ptr.2 to <6 x double>* | ||
%lv.2 = load <6 x double>, <6 x double>* %col.ptr.2.cast, align 8 | ||
%res.1 = fadd <6 x double> %lv.1, %lv.1 | ||
%res.2 = fadd <6 x double> %lv.2, %lv.2 | ||
store <6 x double> %res.1, <6 x double>* %col.ptr.1, align 8 | ||
store <6 x double> %res.2, <6 x double>* %col.ptr.2.cast, align 8 | ||
ret void | ||
} | ||
|
||
; Same as @test1, but the assume uses the sge predicate for %skip >= 0. | ||
define void @test4(double* %ptr, i32 %skip) { | ||
; CHECK-LABEL: Function: test4: 4 pointers, 1 call sites | ||
; CHECK-NEXT: MustAlias: <6 x double>* %col.ptr.1, double* %ptr | ||
; CHECK-NEXT: NoAlias: double* %col.ptr.2, double* %ptr | ||
; CHECK-NEXT: NoAlias: <6 x double>* %col.ptr.1, double* %col.ptr.2 | ||
; CHECK-NEXT: NoAlias: <6 x double>* %col.ptr.2.cast, double* %ptr | ||
; CHECK-NEXT: NoAlias: <6 x double>* %col.ptr.1, <6 x double>* %col.ptr.2.cast | ||
; CHECK-NEXT: MustAlias: <6 x double>* %col.ptr.2.cast, double* %col.ptr.2 | ||
; CHECK-NEXT: NoModRef: Ptr: double* %ptr <-> call void @llvm.assume(i1 %gt) | ||
; CHECK-NEXT: NoModRef: Ptr: <6 x double>* %col.ptr.1 <-> call void @llvm.assume(i1 %gt) | ||
; CHECK-NEXT: NoModRef: Ptr: double* %col.ptr.2 <-> call void @llvm.assume(i1 %gt) | ||
; CHECK-NEXT: NoModRef: Ptr: <6 x double>* %col.ptr.2.cast <-> call void @llvm.assume(i1 %gt) | ||
; | ||
%gt = icmp sge i32 %skip, 0 | ||
call void @llvm.assume(i1 %gt) | ||
%stride = add nsw nuw i32 %skip, 6 | ||
%col.ptr.1 = bitcast double* %ptr to <6 x double>* | ||
%lv.1 = load <6 x double>, <6 x double>* %col.ptr.1, align 8 | ||
%col.ptr.2= getelementptr double, double* %ptr, i32 %stride | ||
%col.ptr.2.cast = bitcast double* %col.ptr.2 to <6 x double>* | ||
%lv.2 = load <6 x double>, <6 x double>* %col.ptr.2.cast, align 8 | ||
%res.1 = fadd <6 x double> %lv.1, %lv.1 | ||
%res.2 = fadd <6 x double> %lv.2, %lv.2 | ||
store <6 x double> %res.1, <6 x double>* %col.ptr.1, align 8 | ||
store <6 x double> %res.2, <6 x double>* %col.ptr.2.cast, align 8 | ||
ret void | ||
} | ||
|
||
declare void @llvm.assume(i1 %cond) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
; RUN: opt -basicaa -print-all-alias-modref-info -aa-eval -analyze < %s 2>&1 | FileCheck %s | ||
|
||
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" | ||
|
||
@G = global i32 0, align 4 | ||
|
||
define i64 @global_and_deref_arg_1(i64* dereferenceable(8) %arg) { | ||
; CHECK: Function: global_and_deref_arg_1: 2 pointers, 0 call sites | ||
; CHECK-NEXT: NoAlias: i32* @G, i64* %arg | ||
bb: | ||
store i64 1, i64* %arg, align 8 | ||
store i32 0, i32* @G, align 4 | ||
%tmp = load i64, i64* %arg, align 8 | ||
ret i64 %tmp | ||
} | ||
|
||
define i32 @global_and_deref_arg_2(i32* dereferenceable(8) %arg) { | ||
; CHECK: Function: global_and_deref_arg_2: 2 pointers, 0 call sites | ||
; CHECK-NEXT: NoAlias: i32* %arg, i32* @G | ||
bb: | ||
store i32 1, i32* %arg, align 8 | ||
store i32 0, i32* @G, align 4 | ||
%tmp = load i32, i32* %arg, align 8 | ||
ret i32 %tmp | ||
} | ||
|
||
define i32 @byval_and_deref_arg_1(i32* byval %obj, i64* dereferenceable(8) %arg) { | ||
; CHECK: Function: byval_and_deref_arg_1: 2 pointers, 0 call sites | ||
; CHECK-NEXT: NoAlias: i32* %obj, i64* %arg | ||
bb: | ||
store i32 1, i32* %obj, align 4 | ||
store i64 0, i64* %arg, align 8 | ||
%tmp = load i32, i32* %obj, align 4 | ||
ret i32 %tmp | ||
} | ||
|
||
define i32 @byval_and_deref_arg_2(i32* byval %obj, i32* dereferenceable(8) %arg) { | ||
; CHECK: Function: byval_and_deref_arg_2: 2 pointers, 0 call sites | ||
; CHECK-NEXT: NoAlias: i32* %arg, i32* %obj | ||
bb: | ||
store i32 1, i32* %obj, align 4 | ||
store i32 0, i32* %arg, align 8 | ||
%tmp = load i32, i32* %obj, align 4 | ||
ret i32 %tmp | ||
} | ||
|
||
declare dereferenceable(8) i32* @get_i32_deref8() | ||
declare dereferenceable(8) i64* @get_i64_deref8() | ||
declare void @unknown(i32*) | ||
|
||
define i32 @local_and_deref_ret_1() { | ||
; CHECK: Function: local_and_deref_ret_1: 2 pointers, 2 call sites | ||
; CHECK-NEXT: NoAlias: i32* %obj, i64* %ret | ||
bb: | ||
%obj = alloca i32 | ||
call void @unknown(i32* %obj) | ||
%ret = call dereferenceable(8) i64* @get_i64_deref8() | ||
store i32 1, i32* %obj, align 4 | ||
store i64 0, i64* %ret, align 8 | ||
%tmp = load i32, i32* %obj, align 4 | ||
ret i32 %tmp | ||
} | ||
|
||
define i32 @local_and_deref_ret_2() { | ||
; CHECK: Function: local_and_deref_ret_2: 2 pointers, 2 call sites | ||
; CHECK-NEXT: NoAlias: i32* %obj, i32* %ret | ||
bb: | ||
%obj = alloca i32 | ||
call void @unknown(i32* %obj) | ||
%ret = call dereferenceable(8) i32* @get_i32_deref8() | ||
store i32 1, i32* %obj, align 4 | ||
store i32 0, i32* %ret, align 8 | ||
%tmp = load i32, i32* %obj, align 4 | ||
ret i32 %tmp | ||
} | ||
|
||
|
||
; Baseline tests, same as above but with 2 instead of 8 dereferenceable bytes. | ||
|
||
define i64 @global_and_deref_arg_non_deref_1(i64* dereferenceable(2) %arg) { | ||
; CHECK: Function: global_and_deref_arg_non_deref_1: 2 pointers, 0 call sites | ||
; CHECK-NEXT: NoAlias: i32* @G, i64* %arg | ||
bb: | ||
store i64 1, i64* %arg, align 8 | ||
store i32 0, i32* @G, align 4 | ||
%tmp = load i64, i64* %arg, align 8 | ||
ret i64 %tmp | ||
} | ||
|
||
define i32 @global_and_deref_arg_non_deref_2(i32* dereferenceable(2) %arg) { | ||
; CHECK: Function: global_and_deref_arg_non_deref_2: 2 pointers, 0 call sites | ||
; Different result than above (see @global_and_deref_arg_2). | ||
; CHECK-NEXT: MayAlias: i32* %arg, i32* @G | ||
bb: | ||
store i32 1, i32* %arg, align 8 | ||
store i32 0, i32* @G, align 4 | ||
%tmp = load i32, i32* %arg, align 8 | ||
ret i32 %tmp | ||
} | ||
|
||
define i32 @byval_and_deref_arg_non_deref_1(i32* byval %obj, i64* dereferenceable(2) %arg) { | ||
; CHECK: Function: byval_and_deref_arg_non_deref_1: 2 pointers, 0 call sites | ||
; CHECK-NEXT: NoAlias: i32* %obj, i64* %arg | ||
bb: | ||
store i32 1, i32* %obj, align 4 | ||
store i64 0, i64* %arg, align 8 | ||
%tmp = load i32, i32* %obj, align 4 | ||
ret i32 %tmp | ||
} | ||
|
||
define i32 @byval_and_deref_arg_non_deref_2(i32* byval %obj, i32* dereferenceable(2) %arg) { | ||
; CHECK: Function: byval_and_deref_arg_non_deref_2: 2 pointers, 0 call sites | ||
; CHECK-NEXT: NoAlias: i32* %arg, i32* %obj | ||
bb: | ||
store i32 1, i32* %obj, align 4 | ||
store i32 0, i32* %arg, align 8 | ||
%tmp = load i32, i32* %obj, align 4 | ||
ret i32 %tmp | ||
} | ||
|
||
declare dereferenceable(2) i32* @get_i32_deref2() | ||
declare dereferenceable(2) i64* @get_i64_deref2() | ||
|
||
define i32 @local_and_deref_ret_non_deref_1() { | ||
; CHECK: Function: local_and_deref_ret_non_deref_1: 2 pointers, 2 call sites | ||
; CHECK-NEXT: NoAlias: i32* %obj, i64* %ret | ||
bb: | ||
%obj = alloca i32 | ||
call void @unknown(i32* %obj) | ||
%ret = call dereferenceable(2) i64* @get_i64_deref2() | ||
store i32 1, i32* %obj, align 4 | ||
store i64 0, i64* %ret, align 8 | ||
%tmp = load i32, i32* %obj, align 4 | ||
ret i32 %tmp | ||
} | ||
|
||
define i32 @local_and_deref_ret_non_deref_2() { | ||
; CHECK: Function: local_and_deref_ret_non_deref_2: 2 pointers, 2 call sites | ||
; Different result than above (see @local_and_deref_ret_2). | ||
; CHECK-NEXT: MayAlias: i32* %obj, i32* %ret | ||
bb: | ||
%obj = alloca i32 | ||
call void @unknown(i32* %obj) | ||
%ret = call dereferenceable(2) i32* @get_i32_deref2() | ||
store i32 1, i32* %obj, align 4 | ||
store i32 0, i32* %ret, align 8 | ||
%tmp = load i32, i32* %obj, align 4 | ||
ret i32 %tmp | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
; RUN: opt -basicaa -aa-eval -print-no-aliases -disable-output %s 2>&1 | FileCheck %s | ||
|
||
%struct = type <{ [20 x i64] }> | ||
|
||
; CHECK-LABEL: Function: test_noalias: 4 pointers, 1 call sites | ||
; CHECK-NEXT: NoAlias: %struct* %ptr1, i64* %ptr2 | ||
; CHECK-NEXT: NoAlias: %struct* %addr.ptr, i64* %ptr2 | ||
; CHECK-NEXT: NoAlias: i64* %gep, i64* %ptr2 | ||
define void @test_noalias(%struct* noalias %ptr1, i64* %ptr2, i64 %offset) { | ||
entry: | ||
%addr.ptr = call %struct* @llvm.ptrmask.p0s_struct.p0s.struct.i64(%struct* %ptr1, i64 72057594037927928) | ||
store i64 10, i64* %ptr2 | ||
%gep = getelementptr inbounds %struct, %struct* %addr.ptr, i64 0, i32 0, i64 %offset | ||
store i64 1, i64* %gep, align 8 | ||
ret void | ||
} | ||
|
||
; CHECK-NEXT: Function: test_alias: 4 pointers, 1 call sites | ||
; CHECK-NOT: NoAlias | ||
define void @test_alias(%struct* %ptr1, i64* %ptr2, i64 %offset) { | ||
entry: | ||
%addr.ptr = call %struct* @llvm.ptrmask.p0s_struct.p0s.struct.i64(%struct* %ptr1, i64 72057594037927928) | ||
store i64 10, i64* %ptr2 | ||
%gep = getelementptr inbounds %struct, %struct* %addr.ptr, i64 0, i32 0, i64 %offset | ||
store i64 1, i64* %gep, align 8 | ||
ret void | ||
} | ||
|
||
declare %struct* @llvm.ptrmask.p0s_struct.p0s.struct.i64(%struct*, i64) |
Oops, something went wrong.