brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1009 B · 63342da Raw
39 lines · plain
1; Test that prof-inject only injects missing metadata2 3; RUN: opt -passes=prof-inject -profcheck-default-function-entry-count=10 %s -S -o - | FileCheck %s4 5define void @foo(i32 %i) {6  %c = icmp eq i32 %i, 07  br i1 %c, label %yes, label %no, !prof !08yes:9  br i1 %c, label %yes2, label %no10yes2:11  ret void12no:13  ret void14}15 16define void @cold(i32 %i) !prof !1 {17  %c = icmp eq i32 %i, 018  br i1 %c, label %yes, label %no19yes:20  br i1 %c, label %yes2, label %no21yes2:22  ret void23no:24  ret void25}26!0 = !{!"branch_weights", i32 1, i32 2}27!1 = !{!"function_entry_count", i32 0}28 29; CHECK-LABEL: @foo30; CHECK: br i1 %c, label %yes, label %no, !prof !131; CHECK: br i1 %c, label %yes2, label %no, !prof !232; CHECK-LABEL: @cold33; CHECK: br i1 %c, label %yes, label %no{{$}}34; CHECK: br i1 %c, label %yes2, label %no{{$}}35; CHECK: !0 = !{!"function_entry_count", i64 10}36; CHECK: !1 = !{!"branch_weights", i32 1, i32 2}37; CHECK: !2 = !{!"branch_weights", i32 3, i32 5}38; CHECK: !3 = !{!"function_entry_count", i32 0}39