summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-mca/Views/ResourcePressureView.cpp
diff options
context:
space:
mode:
authorMatt Davis <Matthew.Davis@sony.com>2018-09-11 18:47:48 +0000
committerMatt Davis <Matthew.Davis@sony.com>2018-09-11 18:47:48 +0000
commitdb834837c2645ed2f3df1e77aff6a4aa14d6980c (patch)
treeedb28df17860ea6553ec0623500d056e4adc9725 /llvm/tools/llvm-mca/Views/ResourcePressureView.cpp
parent44c1b3a331cd58792491a04c623b399b42ba3d1f (diff)
downloadbcm5719-llvm-db834837c2645ed2f3df1e77aff6a4aa14d6980c.tar.gz
bcm5719-llvm-db834837c2645ed2f3df1e77aff6a4aa14d6980c.zip
[llvm-mca] Delay calculation of Cycles per Resources, separate the cycles and resource quantities.
Summary: This patch removes the storing of accumulated floating point data within the llvm-mca library. This patch splits-up the two quantities: cycles and number of resource units. By splitting-up these two quantities, we delay the calculation of "cycles per resource unit" until that value is read, reducing the chance of accumulating floating point error. I considered using the APFloat, but after measuring performance, for a large (many iteration) sample, I decided to go with this faster solution. Reviewers: andreadb, courbet, RKSimon Reviewed By: andreadb Subscribers: llvm-commits, javed.absar, tschuett, gbedwell Differential Revision: https://reviews.llvm.org/D51903 llvm-svn: 341980
Diffstat (limited to 'llvm/tools/llvm-mca/Views/ResourcePressureView.cpp')
-rw-r--r--llvm/tools/llvm-mca/Views/ResourcePressureView.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/tools/llvm-mca/Views/ResourcePressureView.cpp b/llvm/tools/llvm-mca/Views/ResourcePressureView.cpp
index 75f5261b954..bba1e70bc26 100644
--- a/llvm/tools/llvm-mca/Views/ResourcePressureView.cpp
+++ b/llvm/tools/llvm-mca/Views/ResourcePressureView.cpp
@@ -46,7 +46,8 @@ void ResourcePressureView::onEvent(const HWInstructionEvent &Event) {
return;
const auto &IssueEvent = static_cast<const HWInstructionIssuedEvent &>(Event);
const unsigned SourceIdx = Event.IR.getSourceIndex() % Source.size();
- for (const std::pair<ResourceRef, double> &Use : IssueEvent.UsedResources) {
+ for (const std::pair<ResourceRef, ResourceCycles> &Use :
+ IssueEvent.UsedResources) {
const ResourceRef &RR = Use.first;
assert(Resource2VecIndex.find(RR.first) != Resource2VecIndex.end());
unsigned R2VIndex = Resource2VecIndex[RR.first];
OpenPOWER on IntegriCloud