• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt -basic-aa -aa-eval -print-no-aliases -disable-output %s 2>&1 | FileCheck %s
2
3%struct = type <{ [20 x i64] }>
4
5; CHECK-LABEL: Function: test_noalias: 4 pointers, 1 call sites
6; CHECK-NEXT:  NoAlias:	%struct* %ptr1, i64* %ptr2
7; CHECK-NEXT:  NoAlias:	%struct* %addr.ptr, i64* %ptr2
8; CHECK-NEXT:  NoAlias:	i64* %gep, i64* %ptr2
9define void @test_noalias(%struct* noalias %ptr1, i64* %ptr2, i64 %offset) {
10entry:
11  %addr.ptr = call %struct* @llvm.ptrmask.p0s_struct.p0s.struct.i64(%struct* %ptr1, i64 72057594037927928)
12  store i64 10, i64* %ptr2
13  %gep = getelementptr inbounds %struct, %struct* %addr.ptr, i64 0, i32 0, i64 %offset
14  store i64 1, i64* %gep, align 8
15  ret void
16}
17
18; CHECK-NEXT: Function: test_alias: 4 pointers, 1 call sites
19; CHECK-NOT: NoAlias
20define void @test_alias(%struct* %ptr1, i64* %ptr2, i64 %offset) {
21entry:
22  %addr.ptr = call %struct* @llvm.ptrmask.p0s_struct.p0s.struct.i64(%struct* %ptr1, i64 72057594037927928)
23  store i64 10, i64* %ptr2
24  %gep = getelementptr inbounds %struct, %struct* %addr.ptr, i64 0, i32 0, i64 %offset
25  store i64 1, i64* %gep, align 8
26  ret void
27}
28
29declare %struct* @llvm.ptrmask.p0s_struct.p0s.struct.i64(%struct*, i64)
30