diff options
| author | Diego Novillo <dnovillo@google.com> | 2014-03-10 22:41:28 +0000 |
|---|---|---|
| committer | Diego Novillo <dnovillo@google.com> | 2014-03-10 22:41:28 +0000 |
| commit | 92aa8c220af260b5f4792f059549cb0ce7ef0a4d (patch) | |
| tree | 58390dbcdc6802f6ccca300528d909a7645890ef /llvm/test/Transforms/SampleProfile/Inputs | |
| parent | fe50df69838420c6b9f04d7438e4c95a203c5a25 (diff) | |
| download | bcm5719-llvm-92aa8c220af260b5f4792f059549cb0ce7ef0a4d.tar.gz bcm5719-llvm-92aa8c220af260b5f4792f059549cb0ce7ef0a4d.zip | |
Use discriminator information in sample profiles.
Summary:
When the sample profiles include discriminator information,
use the discriminator values to distinguish instruction weights
in different basic blocks.
This modifies the BodySamples mapping to map <line, discriminator> pairs
to weights. Instructions on the same line but different blocks, will
use different discriminator values. This, in turn, means that the blocks
may have different weights.
Other changes in this patch:
- Add tests for positive values of line offset, discriminator and samples.
- Change data types from uint32_t to unsigned and int and do additional
validation.
Reviewers: chandlerc
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2857
llvm-svn: 203508
Diffstat (limited to 'llvm/test/Transforms/SampleProfile/Inputs')
5 files changed, 16 insertions, 3 deletions
diff --git a/llvm/test/Transforms/SampleProfile/Inputs/bad_discriminator_value.prof b/llvm/test/Transforms/SampleProfile/Inputs/bad_discriminator_value.prof new file mode 100644 index 00000000000..cc7f0d4f277 --- /dev/null +++ b/llvm/test/Transforms/SampleProfile/Inputs/bad_discriminator_value.prof @@ -0,0 +1,2 @@ +empty:100:0 +1.-3: 10 diff --git a/llvm/test/Transforms/SampleProfile/Inputs/bad_line_values.prof b/llvm/test/Transforms/SampleProfile/Inputs/bad_line_values.prof new file mode 100644 index 00000000000..61ba7c01591 --- /dev/null +++ b/llvm/test/Transforms/SampleProfile/Inputs/bad_line_values.prof @@ -0,0 +1,2 @@ +empty:100:0 +-1: 10 diff --git a/llvm/test/Transforms/SampleProfile/Inputs/bad_samples.prof b/llvm/test/Transforms/SampleProfile/Inputs/bad_samples.prof new file mode 100644 index 00000000000..a121d8c1ac4 --- /dev/null +++ b/llvm/test/Transforms/SampleProfile/Inputs/bad_samples.prof @@ -0,0 +1,2 @@ +empty:100:0 +1.3: -10 diff --git a/llvm/test/Transforms/SampleProfile/Inputs/calls.prof b/llvm/test/Transforms/SampleProfile/Inputs/calls.prof index 251cb538eff..57d3887dfb6 100644 --- a/llvm/test/Transforms/SampleProfile/Inputs/calls.prof +++ b/llvm/test/Transforms/SampleProfile/Inputs/calls.prof @@ -3,9 +3,8 @@ _Z3sumii:105580:5279 1: 5279 2: 5279 main:225715:0 -2: 5553 +2.1: 5553 3: 5391 # This indicates that at line 3 of this function, the 'then' branch -# of the conditional is taken (discriminator '1'). However, we still -# do not handle this case, so we compute the wrong branch weights here. +# of the conditional is taken (discriminator '1'). 3.1: 5752 _Z3sumii:5860 diff --git a/llvm/test/Transforms/SampleProfile/Inputs/discriminator.prof b/llvm/test/Transforms/SampleProfile/Inputs/discriminator.prof new file mode 100644 index 00000000000..a6bcbc511a1 --- /dev/null +++ b/llvm/test/Transforms/SampleProfile/Inputs/discriminator.prof @@ -0,0 +1,8 @@ +foo:1000:0 +1: 1 +2: 1 +2.1: 100 +3: 100 +3.1: 5 +4: 100 +5: 1 |

