1 ; RUN: opt < %s -S -partial-inliner -skip-partial-inlining-cost-analysis=true | FileCheck %s
4 define i32 @callee_most(i32 %v) unnamed_addr #0 #1 {
6 %cmp = icmp sgt i32 %v, 2000
7 br i1 %cmp, label %if.then, label %if.end
17 %v2 = phi i32 [ %v, %entry ], [ %sub, %if.then2 ]
18 %add = add nsw i32 %v2, 200
22 define i32 @callee_noinline(i32 %v) optnone noinline {
24 %cmp = icmp sgt i32 %v, 2000
25 br i1 %cmp, label %if.then, label %if.end
35 %v2 = phi i32 [ %v, %entry ], [ %sub, %if.then2 ]
36 %add = add nsw i32 %v2, 200
40 define i32 @callee_writeonly(i32 %v) writeonly {
42 %cmp = icmp sgt i32 %v, 2000
43 br i1 %cmp, label %if.then, label %if.end
53 %v2 = phi i32 [ %v, %entry ], [ %sub, %if.then2 ]
54 %add = add nsw i32 %v2, 200
57 ; CHECK-LABEL: @caller
58 ; CHECK: call void @callee_most.2.if.then(i32 %v
59 ; CHECK: call i32 @callee_noinline(i32 %v)
60 ; CHECK: call void @callee_writeonly.1.if.then(i32 %v
61 define i32 @caller(i32 %v) {
63 %c1 = call i32 @callee_most(i32 %v)
64 %c2 = call i32 @callee_noinline(i32 %v)
65 %c3 = call i32 @callee_writeonly(i32 %v)
69 ; CHECK: define internal void @callee_writeonly.1.if.then(i32 %v, i32* %sub.out) {
70 ; CHECK: define internal void @callee_most.2.if.then(i32 %v, i32* %sub.out) [[FN_ATTRS:#[0-9]+]]
72 ; attributes to preserve
74 inlinehint minsize noduplicate noimplicitfloat norecurse noredzone nounwind
75 nonlazybind optsize safestack sanitize_address sanitize_hwaddress sanitize_memory
76 sanitize_thread ssp sspreq sspstrong strictfp uwtable "foo"="bar"
77 "patchable-function"="prologue-short-redirect" "probe-stack"="_foo_guard" "stack-probe-size"="4096" }
79 ; CHECK: attributes [[FN_ATTRS]] = { inlinehint minsize noduplicate noimplicitfloat norecurse noredzone nounwind nonlazybind optsize safestack sanitize_address sanitize_hwaddress sanitize_memory sanitize_thread ssp sspreq sspstrong strictfp uwtable "foo"="bar" "patchable-function"="prologue-short-redirect" "probe-stack"="_foo_guard" "stack-probe-size"="4096" }
83 alignstack=16 convergent inaccessiblememonly inaccessiblemem_or_argmemonly naked
84 noreturn readonly argmemonly returns_twice speculatable "thunk"