diff options
| author | Wenlei He <aktoon@gmail.com> | 2019-08-20 20:52:00 +0000 |
|---|---|---|
| committer | Wenlei He <aktoon@gmail.com> | 2019-08-20 20:52:00 +0000 |
| commit | 5adace352d5ef63fe344dc95a375bd33040ea987 (patch) | |
| tree | 8247dcac8fda3ef360d345a46e1a15aa4c35d286 /llvm/test/tools/llvm-profdata/sample-profile-basic.test | |
| parent | 48e81e8e10ed869f986a256127327713d362eec8 (diff) | |
| download | bcm5719-llvm-5adace352d5ef63fe344dc95a375bd33040ea987.tar.gz bcm5719-llvm-5adace352d5ef63fe344dc95a375bd33040ea987.zip | |
[AutoFDO] Make call targets order deterministic for sample profile
Summary:
StringMap is used for storing call target to frequency map for AutoFDO. However the iterating order of StringMap is non-deterministic, which leads to non-determinism in AutoFDO profile output. Now new API getSortedCallTargets and SortCallTargets are added for deterministic ordering and output.
Roundtrip test for text profile and binary profile is added.
Reviewers: wmi, davidxl, danielcdh
Subscribers: hiraditya, mgrang, llvm-commits, twoh
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D66191
llvm-svn: 369440
Diffstat (limited to 'llvm/test/tools/llvm-profdata/sample-profile-basic.test')
| -rw-r--r-- | llvm/test/tools/llvm-profdata/sample-profile-basic.test | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/test/tools/llvm-profdata/sample-profile-basic.test b/llvm/test/tools/llvm-profdata/sample-profile-basic.test index 3ba42c20f2e..0b0d37aac36 100644 --- a/llvm/test/tools/llvm-profdata/sample-profile-basic.test +++ b/llvm/test/tools/llvm-profdata/sample-profile-basic.test @@ -3,7 +3,7 @@ Basic tests for sample profiles. 1- Show all functions RUN: llvm-profdata show --sample %p/Inputs/sample-profile.proftext | FileCheck %s --check-prefix=SHOW1 SHOW1-DAG: Function: main: 184019, 0, 7 sampled lines -SHOW1-DAG: 9: 2064, calls: _Z3fooi:631 _Z3bari:1471 +SHOW1-DAG: 9: 2064, calls: _Z3bari:1471 _Z3fooi:631 SHOW1-DAG: Function: _Z3fooi: 7711, 610, 1 sampled lines SHOW1-DAG: Function: _Z3bari: 20301, 1437, 1 sampled lines SHOW1-DAG: 1: 1437 @@ -26,7 +26,7 @@ RUN: diff %t-binary %t-text RUN: llvm-profdata merge --sample %p/Inputs/sample-profile.proftext -o %t-binprof RUN: llvm-profdata merge --sample --text %p/Inputs/sample-profile.proftext %t-binprof -o - | FileCheck %s --check-prefix=MERGE1 MERGE1: main:368038:0 -MERGE1: 9: 4128 _Z3fooi:1262 _Z3bari:2942 +MERGE1: 9: 4128 _Z3bari:2942 _Z3fooi:1262 MERGE1: _Z3bari:40602:2874 MERGE1: _Z3fooi:15422:1220 |

