10ca8ddd8SRoman Lebedev; RUN: opt < %s -skip-partial-inlining-cost-analysis -passes=partial-inliner -S | FileCheck %s 2cee313d2SEric Christopher 3*bbbbbfbdSNikita Popovdefine i32 @Func(i1 %cond, ptr align 4 %align.val) !prof !1 { 4cee313d2SEric Christopher; CHECK: @Func({{.*}}) !prof [[REMAINCOUNT:![0-9]+]] 5cee313d2SEric Christopherentry: 6cee313d2SEric Christopher br i1 %cond, label %if.then, label %return 7cee313d2SEric Christopherif.then: 8cee313d2SEric Christopher ; Dummy store to have more than 0 uses 9*bbbbbfbdSNikita Popov store i32 10, ptr %align.val, align 4 10cee313d2SEric Christopher br label %return 11cee313d2SEric Christopherreturn: ; preds = %entry 12cee313d2SEric Christopher ret i32 0 13cee313d2SEric Christopher} 14cee313d2SEric Christopher 15*bbbbbfbdSNikita Popovdefine internal i32 @Caller1(i1 %cond, ptr align 2 %align.val) !prof !3{ 16cee313d2SEric Christopherentry: 17cee313d2SEric Christopher; CHECK-LABEL: @Caller1 18cee313d2SEric Christopher; CHECK: br 19cee313d2SEric Christopher; CHECK: call void @Func.1. 20cee313d2SEric Christopher; CHECK: br 21cee313d2SEric Christopher; CHECK: call void @Func.1. 22*bbbbbfbdSNikita Popov %val = call i32 @Func(i1 %cond, ptr %align.val) 23*bbbbbfbdSNikita Popov %val2 = call i32 @Func(i1 %cond, ptr %align.val) 24cee313d2SEric Christopher ret i32 %val 25cee313d2SEric Christopher} 26cee313d2SEric Christopher 27*bbbbbfbdSNikita Popovdefine internal i32 @Caller2(i1 %cond, ptr align 2 %align.val) !prof !2{ 28cee313d2SEric Christopherentry: 29cee313d2SEric Christopher; CHECK-LABEL: @Caller2 30cee313d2SEric Christopher; CHECK: br 31cee313d2SEric Christopher; CHECK: call void @Func.1. 32*bbbbbfbdSNikita Popov %val = call i32 @Func(i1 %cond, ptr %align.val) 33cee313d2SEric Christopher ret i32 %val 34cee313d2SEric Christopher} 35cee313d2SEric Christopher 36cee313d2SEric Christopher; CHECK: [[REMAINCOUNT]] = !{!"function_entry_count", i64 150} 37cee313d2SEric Christopher!1 = !{!"function_entry_count", i64 200} 38cee313d2SEric Christopher!2 = !{!"function_entry_count", i64 10} 39cee313d2SEric Christopher!3 = !{!"function_entry_count", i64 20} 40cee313d2SEric Christopher 41