Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PGO] Don't cross reference CSFDO profile and non-CSFDO profile
Don't cross reference CSFDO profile and non-CSFDO profile when checking the function hash. Only return hash_mismatch when CS bits match, and return unknown_function otherwise. Differential Revision: https://reviews.llvm.org/D129000
- Loading branch information
Showing
3 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
llvm/test/Transforms/PGOProfile/Inputs/cs_vs_nocs.proftext
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# CSIR level Instrumentation Flag | ||
:csir | ||
bar | ||
# Func Hash: | ||
1895182923573755903 | ||
# Num Counters: | ||
1 | ||
# Counter Values: | ||
100000 | ||
|
13 changes: 13 additions & 0 deletions
13
llvm/test/Transforms/PGOProfile/diag_no_funcprofdata_cs.ll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
; RUN: llvm-profdata merge %S/Inputs/cs_vs_nocs.proftext -o %t.profdata | ||
; RUN: opt < %s -passes=pgo-instr-use -pgo-warn-missing-function=true -pgo-test-profile-file=%t.profdata -S 2>&1 | FileCheck %s | ||
|
||
; CHECK: warning: {{.+}}: no profile data available for function bar | ||
; CHECK-NOT: warning: {{.+}}: function control flow change detected (hash mismatch) | ||
|
||
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" | ||
target triple = "x86_64-unknown-linux-gnu" | ||
|
||
define i32 @bar() { | ||
entry: | ||
ret i32 0 | ||
} |