1 ; RUN: opt -S -passes=attributor -aa-pipeline='basic-aa' -attributor-disable=false -attributor-max-iterations-verify -attributor-max-iterations=3 < %s | FileCheck %s
3 define dso_local i32 @visible(i32* noalias %A, i32* noalias %B) #0 {
5 %call1 = call i32 @noalias_args(i32* %A, i32* %B)
6 %call2 = call i32 @noalias_args_argmem(i32* %A, i32* %B)
7 %add = add nsw i32 %call1, %call2
11 ; CHECK: define private i32 @noalias_args(i32* nocapture nonnull readonly dereferenceable(4) %A, i32* noalias nocapture nonnull readonly dereferenceable(4) %B)
13 define private i32 @noalias_args(i32* %A, i32* %B) #0 {
15 %0 = load i32, i32* %A, align 4
16 %1 = load i32, i32* %B, align 4
17 %add = add nsw i32 %0, %1
18 %call = call i32 @noalias_args_argmem(i32* %A, i32* %B)
19 %add2 = add nsw i32 %add, %call
24 ; FIXME: Should be something like this.
25 ; define internal i32 @noalias_args_argmem(i32* noalias nocapture readonly %A, i32* noalias nocapture readonly %B)
26 ; CHECK: define internal i32 @noalias_args_argmem(i32* nocapture nonnull readonly dereferenceable(4) %A, i32* nocapture nonnull readonly dereferenceable(4) %B)
29 define internal i32 @noalias_args_argmem(i32* %A, i32* %B) #1 {
31 %0 = load i32, i32* %A, align 4
32 %1 = load i32, i32* %B, align 4
33 %add = add nsw i32 %0, %1
37 define dso_local i32 @visible_local(i32* %A) #0 {
39 %B = alloca i32, align 4
40 store i32 5, i32* %B, align 4
41 %call1 = call i32 @noalias_args(i32* %A, i32* nonnull %B)
42 %call2 = call i32 @noalias_args_argmem(i32* %A, i32* nonnull %B)
43 %add = add nsw i32 %call1, %call2
47 attributes #0 = { noinline nounwind uwtable willreturn }
48 attributes #1 = { argmemonly noinline nounwind uwtable willreturn}