|
| 1 | +; REQUIRES: x86-registered-target |
| 2 | + |
| 3 | +; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -split-machine-functions -O0 -mfs-psi-cutoff=0 -mfs-count-threshold=10000 | FileCheck %s |
| 4 | + |
| 5 | +;; Check that functions with optnone attribute are not split. |
| 6 | +; CHECK-LABEL: foo_optnone: |
| 7 | +; CHECK-NOT: .section .text.split.foo_optnone |
| 8 | +; CHECK-NOT: foo_optnone.cold: |
| 9 | +; CHECK: .LBB0_2: |
| 10 | +; CHECK: .size foo_optnone |
| 11 | + |
| 12 | +define void @foo_optnone(i1 zeroext %0) nounwind optnone noinline !prof !14 !section_prefix !15 { |
| 13 | +entry: |
| 14 | + br i1 %0, label %hot, label %cold, !prof !17 |
| 15 | + |
| 16 | +hot: |
| 17 | + %1 = call i32 @bar() |
| 18 | + br label %exit |
| 19 | + |
| 20 | +cold: |
| 21 | + %2 = call i32 @baz() |
| 22 | + br label %exit |
| 23 | + |
| 24 | +exit: |
| 25 | + %3 = tail call i32 @qux() |
| 26 | + ret void |
| 27 | +} |
| 28 | + |
| 29 | +declare i32 @bar() |
| 30 | +declare i32 @baz() |
| 31 | +declare i32 @qux() |
| 32 | + |
| 33 | +!llvm.module.flags = !{!0} |
| 34 | +!0 = !{i32 1, !"ProfileSummary", !1} |
| 35 | +!1 = !{!2, !3, !4, !5, !6, !7, !8, !9} |
| 36 | +!2 = !{!"ProfileFormat", !"InstrProf"} |
| 37 | +!3 = !{!"TotalCount", i64 10000} |
| 38 | +!4 = !{!"MaxCount", i64 10} |
| 39 | +!5 = !{!"MaxInternalCount", i64 1} |
| 40 | +!6 = !{!"MaxFunctionCount", i64 1000} |
| 41 | +!7 = !{!"NumCounts", i64 3} |
| 42 | +!8 = !{!"NumFunctions", i64 5} |
| 43 | +!9 = !{!"DetailedSummary", !10} |
| 44 | +!10 = !{!11, !12, !13} |
| 45 | +!11 = !{i32 10000, i64 100, i32 1} |
| 46 | +!12 = !{i32 999900, i64 100, i32 1} |
| 47 | +!13 = !{i32 999999, i64 1, i32 2} |
| 48 | +!14 = !{!"function_entry_count", i64 7000} |
| 49 | +!15 = !{!"function_section_prefix", !"hot"} |
| 50 | +!17 = !{!"branch_weights", i32 7000, i32 0} |
0 commit comments