Skip to content

Commit

Permalink
llvm: update test cases to LLVM 10.0
Browse files Browse the repository at this point in the history
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
mewmew committed Mar 26, 2020
1 parent f87b279 commit 998e529
Show file tree
Hide file tree
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.
4 changes: 2 additions & 2 deletions llvm/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# LLVM version.
VER=9.0.0
VER=10.0.0

ROOT_DIR=$(shell pwd)

Expand All @@ -21,7 +21,7 @@ llvm-${VER}.src: | llvm-${VER}.src.tar.xz
tar -xJf llvm-${VER}.src.tar.xz

llvm-${VER}.src.tar.xz:
wget -O $@ "https://releases.llvm.org/${VER}/llvm-${VER}.src.tar.xz"
wget -O $@ "https://github.com/llvm/llvm-project/releases/download/llvmorg-${VER}/llvm-${VER}.src.tar.xz"
touch $@

clean:
Expand Down
116 changes: 116 additions & 0 deletions llvm/test/Analysis/BasicAA/assume-index-positive.ll
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)
40 changes: 20 additions & 20 deletions llvm/test/Analysis/BasicAA/cs-cs.ll
Original file line number Diff line number Diff line change
Expand Up @@ -364,26 +364,26 @@ entry:
call void @an_argmemonly_func(i8* %q) #9 [ "unknown"() ]
ret void

; CHECK: Just Ref: Ptr: i8* %p <-> call void @a_readonly_func(i8* %p) #6 [ "unknown"() ]
; CHECK: Just Ref: Ptr: i8* %q <-> call void @a_readonly_func(i8* %p) #6 [ "unknown"() ]
; CHECK: NoModRef: Ptr: i8* %p <-> call void @an_inaccessiblememonly_func() #7 [ "unknown"() ]
; CHECK: NoModRef: Ptr: i8* %q <-> call void @an_inaccessiblememonly_func() #7 [ "unknown"() ]
; CHECK: NoModRef: Ptr: i8* %p <-> call void @an_inaccessibleorargmemonly_func(i8* %q) #8 [ "unknown"() ]
; CHECK: Both ModRef (MustAlias): Ptr: i8* %q <-> call void @an_inaccessibleorargmemonly_func(i8* %q) #8 [ "unknown"() ]
; CHECK: NoModRef: Ptr: i8* %p <-> call void @an_argmemonly_func(i8* %q) #9 [ "unknown"() ]
; CHECK: Both ModRef (MustAlias): Ptr: i8* %q <-> call void @an_argmemonly_func(i8* %q) #9 [ "unknown"() ]
; CHECK: Just Ref: call void @a_readonly_func(i8* %p) #6 [ "unknown"() ] <-> call void @an_inaccessiblememonly_func() #7 [ "unknown"() ]
; CHECK: Just Ref: call void @a_readonly_func(i8* %p) #6 [ "unknown"() ] <-> call void @an_inaccessibleorargmemonly_func(i8* %q) #8 [ "unknown"() ]
; CHECK: Just Ref: call void @a_readonly_func(i8* %p) #6 [ "unknown"() ] <-> call void @an_argmemonly_func(i8* %q) #9 [ "unknown"() ]
; CHECK: Both ModRef: call void @an_inaccessiblememonly_func() #7 [ "unknown"() ] <-> call void @a_readonly_func(i8* %p) #6 [ "unknown"() ]
; CHECK: Both ModRef: call void @an_inaccessiblememonly_func() #7 [ "unknown"() ] <-> call void @an_inaccessibleorargmemonly_func(i8* %q) #8 [ "unknown"() ]
; CHECK: NoModRef: call void @an_inaccessiblememonly_func() #7 [ "unknown"() ] <-> call void @an_argmemonly_func(i8* %q) #9 [ "unknown"() ]
; CHECK: Both ModRef: call void @an_inaccessibleorargmemonly_func(i8* %q) #8 [ "unknown"() ] <-> call void @a_readonly_func(i8* %p) #6 [ "unknown"() ]
; CHECK: Both ModRef: call void @an_inaccessibleorargmemonly_func(i8* %q) #8 [ "unknown"() ] <-> call void @an_inaccessiblememonly_func() #7 [ "unknown"() ]
; CHECK: Both ModRef (MustAlias): call void @an_inaccessibleorargmemonly_func(i8* %q) #8 [ "unknown"() ] <-> call void @an_argmemonly_func(i8* %q) #9 [ "unknown"() ]
; CHECK: Both ModRef: call void @an_argmemonly_func(i8* %q) #9 [ "unknown"() ] <-> call void @a_readonly_func(i8* %p) #6 [ "unknown"() ]
; CHECK: NoModRef: call void @an_argmemonly_func(i8* %q) #9 [ "unknown"() ] <-> call void @an_inaccessiblememonly_func() #7 [ "unknown"() ]
; CHECK: Both ModRef (MustAlias): call void @an_argmemonly_func(i8* %q) #9 [ "unknown"() ] <-> call void @an_inaccessibleorargmemonly_func(i8* %q) #8 [ "unknown"() ]
; CHECK: Just Ref: Ptr: i8* %p <-> call void @a_readonly_func(i8* %p) #7 [ "unknown"() ]
; CHECK: Just Ref: Ptr: i8* %q <-> call void @a_readonly_func(i8* %p) #7 [ "unknown"() ]
; CHECK: NoModRef: Ptr: i8* %p <-> call void @an_inaccessiblememonly_func() #8 [ "unknown"() ]
; CHECK: NoModRef: Ptr: i8* %q <-> call void @an_inaccessiblememonly_func() #8 [ "unknown"() ]
; CHECK: NoModRef: Ptr: i8* %p <-> call void @an_inaccessibleorargmemonly_func(i8* %q) #9 [ "unknown"() ]
; CHECK: Both ModRef (MustAlias): Ptr: i8* %q <-> call void @an_inaccessibleorargmemonly_func(i8* %q) #9 [ "unknown"() ]
; CHECK: NoModRef: Ptr: i8* %p <-> call void @an_argmemonly_func(i8* %q) #10 [ "unknown"() ]
; CHECK: Both ModRef (MustAlias): Ptr: i8* %q <-> call void @an_argmemonly_func(i8* %q) #10 [ "unknown"() ]
; CHECK: Just Ref: call void @a_readonly_func(i8* %p) #7 [ "unknown"() ] <-> call void @an_inaccessiblememonly_func() #8 [ "unknown"() ]
; CHECK: Just Ref: call void @a_readonly_func(i8* %p) #7 [ "unknown"() ] <-> call void @an_inaccessibleorargmemonly_func(i8* %q) #9 [ "unknown"() ]
; CHECK: Just Ref: call void @a_readonly_func(i8* %p) #7 [ "unknown"() ] <-> call void @an_argmemonly_func(i8* %q) #10 [ "unknown"() ]
; CHECK: Both ModRef: call void @an_inaccessiblememonly_func() #8 [ "unknown"() ] <-> call void @a_readonly_func(i8* %p) #7 [ "unknown"() ]
; CHECK: Both ModRef: call void @an_inaccessiblememonly_func() #8 [ "unknown"() ] <-> call void @an_inaccessibleorargmemonly_func(i8* %q) #9 [ "unknown"() ]
; CHECK: NoModRef: call void @an_inaccessiblememonly_func() #8 [ "unknown"() ] <-> call void @an_argmemonly_func(i8* %q) #10 [ "unknown"() ]
; CHECK: Both ModRef: call void @an_inaccessibleorargmemonly_func(i8* %q) #9 [ "unknown"() ] <-> call void @a_readonly_func(i8* %p) #7 [ "unknown"() ]
; CHECK: Both ModRef: call void @an_inaccessibleorargmemonly_func(i8* %q) #9 [ "unknown"() ] <-> call void @an_inaccessiblememonly_func() #8 [ "unknown"() ]
; CHECK: Both ModRef (MustAlias): call void @an_inaccessibleorargmemonly_func(i8* %q) #9 [ "unknown"() ] <-> call void @an_argmemonly_func(i8* %q) #10 [ "unknown"() ]
; CHECK: Both ModRef: call void @an_argmemonly_func(i8* %q) #10 [ "unknown"() ] <-> call void @a_readonly_func(i8* %p) #7 [ "unknown"() ]
; CHECK: NoModRef: call void @an_argmemonly_func(i8* %q) #10 [ "unknown"() ] <-> call void @an_inaccessiblememonly_func() #8 [ "unknown"() ]
; CHECK: Both ModRef (MustAlias): call void @an_argmemonly_func(i8* %q) #10 [ "unknown"() ] <-> call void @an_inaccessibleorargmemonly_func(i8* %q) #9 [ "unknown"() ]
}

attributes #0 = { argmemonly nounwind }
Expand Down
149 changes: 149 additions & 0 deletions llvm/test/Analysis/BasicAA/dereferenceable.ll
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
}
2 changes: 1 addition & 1 deletion llvm/test/Analysis/BasicAA/gep-alias.ll
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ define i32 @test12(i32 %x, i32 %y, i8* %p) nounwind {
; CHECK: [[U0ADDR:%[a-zA-Z0-9_]+]] = getelementptr inbounds [3 x i8], [3 x i8]* %u, i32 0, i32 0
; CHECK: [[U0:%[a-zA-Z0-9_]+]] = load i8, i8* [[U0ADDR]], align 1
; CHECK: [[U0ARG:%[a-zA-Z0-9_]+]] = zext i8 [[U0]] to i32
; CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i32 0, i32 0), i32 [[T0ARG]], i32 [[U0ARG]])
; CHECK: call i32 (i8*, ...) @printf(i8* nonnull dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i32 0, i32 0), i32 [[T0ARG]], i32 [[U0ARG]])
; CHECK: ret
define void @test13() {
entry:
Expand Down
4 changes: 2 additions & 2 deletions llvm/test/Analysis/BasicAA/intrinsics.ll
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ entry:
declare <8 x i16> @llvm.masked.load.v8i16.p0v8i16(<8 x i16>*, i32, <8 x i1>, <8 x i16>) nounwind readonly
declare void @llvm.masked.store.v8i16.p0v8i16(<8 x i16>, <8 x i16>*, i32, <8 x i1>) nounwind

; CHECK: attributes #0 = { argmemonly nounwind readonly }
; CHECK: attributes #1 = { argmemonly nounwind }
; CHECK: attributes #0 = { argmemonly nounwind readonly willreturn }
; CHECK: attributes #1 = { argmemonly nounwind willreturn }
; CHECK: attributes [[ATTR]] = { nounwind }
29 changes: 29 additions & 0 deletions llvm/test/Analysis/BasicAA/ptrmask.ll
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)
Loading

0 comments on commit 998e529

Please sign in to comment.