1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --scrub-attributes --check-attributes --check-globals
2 ; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -attributor-max-initialization-chain-length=1 -S < %s | FileCheck %s --check-prefixes=CHECK,CHECK_1
3 ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-annotate-decl-cs -attributor-max-initialization-chain-length=1 -S < %s | FileCheck %s --check-prefixes=CHECK,CHECK_1
4 ; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -attributor-max-initialization-chain-length=1024 -S < %s | FileCheck %s --check-prefixes=CHECK,CHECK_5
5 ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-annotate-decl-cs -attributor-max-initialization-chain-length=1024 -S < %s | FileCheck %s --check-prefixes=CHECK,CHECK_5
7 declare void @foo(i8* dereferenceable(8) %arg)
9 define dso_local i32 @bar(i32* %arg) {
10 ; CHECK_1-LABEL: define {{[^@]+}}@bar
11 ; CHECK_1-SAME: (i32* dereferenceable_or_null(8) [[ARG:%.*]]) {
12 ; CHECK_1-NEXT: entry:
13 ; CHECK_1-NEXT: [[BC1:%.*]] = bitcast i32* [[ARG]] to i8*
14 ; CHECK_1-NEXT: call void @foo(i8* noundef dereferenceable_or_null(8) [[BC1]])
15 ; CHECK_1-NEXT: [[LD:%.*]] = load i32, i32* [[ARG]], align 4
16 ; CHECK_1-NEXT: ret i32 [[LD]]
18 ; CHECK_5-LABEL: define {{[^@]+}}@bar
19 ; CHECK_5-SAME: (i32* nonnull dereferenceable(8) [[ARG:%.*]]) {
20 ; CHECK_5-NEXT: entry:
21 ; CHECK_5-NEXT: [[BC1:%.*]] = bitcast i32* [[ARG]] to i8*
22 ; CHECK_5-NEXT: call void @foo(i8* noundef nonnull dereferenceable(8) [[BC1]])
23 ; CHECK_5-NEXT: [[LD:%.*]] = load i32, i32* [[ARG]], align 4
24 ; CHECK_5-NEXT: ret i32 [[LD]]
27 %bc1 = bitcast i32* %arg to i8*
28 call void @foo(i8* %bc1)
29 %ld = load i32, i32* %arg