1 ; RUN: opt < %s -S -passes=inline | FileCheck %s
2 ; RUN: opt < %s -S -passes='cgscc(inline)' | FileCheck %s
4 ; Make sure that profile and unpredictable metadata is preserved when cloning a select.
6 define i32 @callee_with_select(i1 %c, i32 %a, i32 %b) {
7 %sel = select i1 %c, i32 %a, i32 %b, !prof !0, !unpredictable !1
11 define i32 @caller_of_select(i1 %C, i32 %A, i32 %B) {
12 %ret = call i32 @callee_with_select(i1 %C, i32 %A, i32 %B)
15 ; CHECK-LABEL: @caller_of_select(
16 ; CHECK-NEXT: [[SEL:%.*]] = select i1 %C, i32 %A, i32 %B, !prof !0, !unpredictable !1
17 ; CHECK-NEXT: ret i32 [[SEL]]
20 ; Make sure that profile and unpredictable metadata is preserved when cloning a branch.
22 define i32 @callee_with_branch(i1 %c) {
23 br i1 %c, label %if, label %else, !unpredictable !1, !prof !2
30 define i32 @caller_of_branch(i1 %C) {
31 %ret = call i32 @callee_with_branch(i1 %C)
34 ; CHECK-LABEL: @caller_of_branch(
35 ; CHECK-NEXT: br i1 %C, label %{{.*}}, label %{{.*}}, !prof !2, !unpredictable !1
38 !0 = !{!"branch_weights", i32 1, i32 2}
40 !2 = !{!"branch_weights", i32 3, i32 4}
42 ; CHECK: !0 = !{!"branch_weights", i32 1, i32 2}
44 ; CHECK: !2 = !{!"branch_weights", i32 3, i32 4}