Ken Matsui da47a80d03
[PGO][test] Specify exact match for check labels (#117376)
Some check labels in the basic.ll test are simply f[1-3], which matches
all cases where the function entry is hot, cold, or uncategorized. Since
the actual test results for each label have mixed cases, the current
labels can be considered ambiguous.

This patch specifies exact matches for each label to ensure more precise
validation and to prevent potential regressions in the future.
2025-02-18 20:49:34 -05:00

60 lines
2.1 KiB
LLVM

; RUN: opt < %s -disable-output -passes=print-profile-summary -S 2>&1 | FileCheck %s
; RUN: opt < %s -disable-output -profile-summary-hot-count=500 -passes=print-profile-summary -S 2>&1 | FileCheck %s -check-prefixes=OVERRIDE-HOT
; RUN: opt < %s -disable-output -profile-summary-cold-count=0 -passes=print-profile-summary -S 2>&1 | FileCheck %s -check-prefixes=OVERRIDE-COLD
; RUN: opt < %s -disable-output -profile-summary-cold-count=200 -profile-summary-hot-count=1000 -passes=print-profile-summary -S 2>&1 | FileCheck %s -check-prefixes=OVERRIDE-BOTH
; RUN: opt < %s -disable-output -profile-summary-cutoff-hot=0 -passes=print-profile-summary -S 2>&1 | FileCheck %s -check-prefixes=HOT-CUTOFF-0
; RUN: opt < %s -disable-output -profile-summary-cutoff-cold=0 -profile-summary-hot-count=18446744073709551615 -passes=print-profile-summary -S 2>&1 | FileCheck %s -check-prefixes=COLD-CUTOFF-0
define void @f1() !prof !20 {
; CHECK-LABEL: f1 :hot
; OVERRIDE-HOT-LABEL: f1{{$}}
; OVERRIDE-COLD-LABEL: f1 :hot
; OVERRIDE-BOTH-LABEL: f1{{$}}
; HOT-CUTOFF-0-LABEL: f1{{$}}
; COLD-CUTOFF-0-LABEL: f1 :cold
ret void
}
define void @f2() !prof !21 {
; CHECK-LABEL: f2 :cold
; OVERRIDE-HOT-LABEL: f2 :cold
; OVERRIDE-COLD-LABEL: f2{{$}}
; OVERRIDE-BOTH-LABEL: f2 :cold
; HOT-CUTOFF-0-LABEL: f2 :cold
; COLD-CUTOFF-0-LABEL: f2 :cold
ret void
}
define void @f3() !prof !22 {
; CHECK-LABEL: f3 :hot
; OVERRIDE-HOT-LABEL: f3{{$}}
; OVERRIDE-COLD-LABEL: f3 :hot
; OVERRIDE-BOTH-LABEL: f3 :cold
; HOT-CUTOFF-0-LABEL: f3{{$}}
; COLD-CUTOFF-0-LABEL: f3 :cold
ret void
}
!llvm.module.flags = !{!1}
!20 = !{!"function_entry_count", i64 400}
!21 = !{!"function_entry_count", i64 1}
!22 = !{!"function_entry_count", i64 100}
!1 = !{i32 1, !"ProfileSummary", !2}
!2 = !{!3, !4, !5, !6, !7, !8, !9, !10}
!3 = !{!"ProfileFormat", !"InstrProf"}
!4 = !{!"TotalCount", i64 10000}
!5 = !{!"MaxCount", i64 10}
!6 = !{!"MaxInternalCount", i64 1}
!7 = !{!"MaxFunctionCount", i64 1000}
!8 = !{!"NumCounts", i64 3}
!9 = !{!"NumFunctions", i64 3}
!10 = !{!"DetailedSummary", !11}
!11 = !{!12, !13, !14}
!12 = !{i32 10000, i64 100, i32 1}
!13 = !{i32 999000, i64 100, i32 1}
!14 = !{i32 999999, i64 1, i32 2}