Skip to content

[PGO][test] Specify exact match for check labels #117376

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

ken-matsui
Copy link
Member

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.

@llvmbot
Copy link
Member

llvmbot commented Nov 22, 2024

@llvm/pr-subscribers-llvm-analysis

Author: Ken Matsui (ken-matsui)

Changes

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.


Full diff: https://github.com/llvm/llvm-project/pull/117376.diff

1 Files Affected:

  • (modified) llvm/test/Analysis/ProfileSummary/basic.ll (+8-8)
diff --git a/llvm/test/Analysis/ProfileSummary/basic.ll b/llvm/test/Analysis/ProfileSummary/basic.ll
index 966a1117c47d14..5a2d03c346903f 100644
--- a/llvm/test/Analysis/ProfileSummary/basic.ll
+++ b/llvm/test/Analysis/ProfileSummary/basic.ll
@@ -5,9 +5,9 @@
 
 define void @f1() !prof !20 {
 ; CHECK-LABEL: f1 :hot
-; OVERRIDE-HOT-LABEL: f1
+; OVERRIDE-HOT-LABEL: f1{{$}}
 ; OVERRIDE-COLD-LABEL: f1 :hot
-; OVERRIDE-BOTH-LABEL: f1
+; OVERRIDE-BOTH-LABEL: f1{{$}}
 
   ret void
 }
@@ -15,17 +15,17 @@ define void @f1() !prof !20 {
 define void @f2() !prof !21 {
 ; CHECK-LABEL: f2 :cold
 ; OVERRIDE-HOT-LABEL: f2 :cold
-; OVERRIDE-COLD-LABEL: f2
-; OVERRIDE-BOTH-LABEL: f2
+; OVERRIDE-COLD-LABEL: f2{{$}}
+; OVERRIDE-BOTH-LABEL: f2 :cold
 
   ret void
 }
 
 define void @f3() !prof !22 {
-; CHECK-LABEL: f3
-; OVERRIDE-HOT-LABEL: f3
-; OVERRIDE-COLD-LABEL: f3
-; OVERRIDE-BOTH-LABEL: f3
+; CHECK-LABEL: f3 :hot
+; OVERRIDE-HOT-LABEL: f3{{$}}
+; OVERRIDE-COLD-LABEL: f3 :hot
+; OVERRIDE-BOTH-LABEL: f3 :cold
 
   ret void
 }

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.
@ken-matsui ken-matsui force-pushed the fix-profile-summary-basic-test-ambiguity branch from 4d73c01 to ff5edc8 Compare February 19, 2025 00:55
@mtrofin mtrofin self-requested a review February 19, 2025 01:40
@mtrofin
Copy link
Member

mtrofin commented Feb 19, 2025

LGTM

@ken-matsui
Copy link
Member Author

Thank you!

@ken-matsui ken-matsui merged commit da47a80 into llvm:main Feb 19, 2025
8 checks passed
@ken-matsui ken-matsui deleted the fix-profile-summary-basic-test-ambiguity branch February 19, 2025 01:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants