1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals
2 ; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=11 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM
3 ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=11 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM
4 ; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM
5 ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM
7 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
9 %0 = type { i32, %1, %2* }
13 define hidden %0* @f1(i64 %0, i64 %1) {
14 ; CHECK-LABEL: define {{[^@]+}}@f1
15 ; CHECK-SAME: (i64 [[TMP0:%.*]], i64 [[TMP1:%.*]]) {
16 ; CHECK-NEXT: [[TMP3:%.*]] = call { %0*, i64 } @f3(i64 [[TMP0]])
17 ; CHECK-NEXT: ret %0* undef
19 %3 = call { %0*, i64 } @f3(i64 %0)
23 define linkonce_odr hidden { %0*, i64 } @f3(i64 %0) align 2 {
24 ; CHECK-LABEL: define {{[^@]+}}@f3
25 ; CHECK-SAME: (i64 [[TMP0:%.*]]) align 2 {
26 ; CHECK-NEXT: [[TMP2:%.*]] = call i32 @f4()
27 ; CHECK-NEXT: [[TMP3:%.*]] = zext i32 [[TMP2]] to i64
28 ; CHECK-NEXT: call void @f5(i64 [[TMP3]], i64 [[TMP0]]) #[[ATTR0:[0-9]+]]
29 ; CHECK-NEXT: ret { %0*, i64 } undef
32 %3 = zext i32 %2 to i64
33 call void @f5(i64 %3, i64 %0)
34 ret { %0*, i64 } undef
37 define linkonce_odr hidden i32 @f4() align 2 {
38 ; CHECK-LABEL: define {{[^@]+}}@f4() align 2 {
39 ; CHECK-NEXT: ret i32 16
44 define internal void @f5(i64 %0, i64 %1) {
45 ; CHECK: Function Attrs: nounwind
46 ; CHECK-LABEL: define {{[^@]+}}@f5
47 ; CHECK-SAME: (i64 [[TMP0:%.*]], i64 [[TMP1:%.*]]) #[[ATTR0]] {
48 ; CHECK-NEXT: br label [[TMP3:%.*]]
50 ; CHECK-NEXT: call void @f6(i64 [[TMP0]]) #[[ATTR0]]
51 ; CHECK-NEXT: [[TMP4:%.*]] = icmp sgt i64 [[TMP1]], [[TMP0]]
52 ; CHECK-NEXT: br i1 [[TMP4]], label [[TMP5:%.*]], label [[TMP6:%.*]]
54 ; CHECK-NEXT: ret void
56 ; CHECK-NEXT: call void @f5(i64 [[TMP0]], i64 [[TMP1]]) #[[ATTR0]]
57 ; CHECK-NEXT: br label [[TMP3]]
63 %4 = icmp sgt i64 %1, %0
64 br i1 %4, label %5, label %6
70 call void @f5(i64 %0, i64 %1)
74 define internal void @f6(i64 %0) {
75 ; CHECK: Function Attrs: nounwind
76 ; CHECK-LABEL: define {{[^@]+}}@f6
77 ; CHECK-SAME: (i64 [[TMP0:%.*]]) #[[ATTR0]] {
78 ; CHECK-NEXT: [[TMP2:%.*]] = icmp sgt i64 [[TMP0]], 0
79 ; CHECK-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP4:%.*]]
81 ; CHECK-NEXT: call void @llvm.trap() #[[ATTR2:[0-9]+]]
82 ; CHECK-NEXT: unreachable
84 ; CHECK-NEXT: ret void
86 %2 = icmp sgt i64 %0, 0
87 br i1 %2, label %3, label %4
90 call void @llvm.trap()
97 ; Function Attrs: cold noreturn nounwind
98 declare void @llvm.trap() #0
100 attributes #0 = { cold noreturn nounwind }
103 ; CHECK: attributes #[[ATTR0]] = { nounwind }
104 ; CHECK: attributes #[[ATTR1:[0-9]+]] = { cold noreturn nounwind }
105 ; CHECK: attributes #[[ATTR2]] = { noreturn }