summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-mca/Support.h
diff options
context:
space:
mode:
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>2018-06-01 14:35:21 +0000
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>2018-06-01 14:35:21 +0000
commitbdc670611b5c204703b06812aacf23278a1c3da5 (patch)
treea42c064db546f02a394eb04583840ff3aa91c548 /llvm/tools/llvm-mca/Support.h
parent9796b47df1a2dd2a0f16dff7752d8bbd8e52533e (diff)
downloadbcm5719-llvm-bdc670611b5c204703b06812aacf23278a1c3da5.tar.gz
bcm5719-llvm-bdc670611b5c204703b06812aacf23278a1c3da5.zip
[llvm-mca] Move the logic that computes the block throughput into Support.h. NFC
This will allow us to share the logic that computes the block throughput with other views. llvm-svn: 333755
Diffstat (limited to 'llvm/tools/llvm-mca/Support.h')
-rw-r--r--llvm/tools/llvm-mca/Support.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/tools/llvm-mca/Support.h b/llvm/tools/llvm-mca/Support.h
index a29ef8b58e2..98302e7e15c 100644
--- a/llvm/tools/llvm-mca/Support.h
+++ b/llvm/tools/llvm-mca/Support.h
@@ -15,6 +15,7 @@
#ifndef LLVM_TOOLS_LLVM_MCA_SUPPORT_H
#define LLVM_TOOLS_LLVM_MCA_SUPPORT_H
+#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/MC/MCSchedule.h"
@@ -44,6 +45,14 @@ namespace mca {
/// problems with simple bit manipulation operations.
void computeProcResourceMasks(const llvm::MCSchedModel &SM,
llvm::SmallVectorImpl<uint64_t> &Masks);
+
+/// Compute the reciprocal block throughput from a set of processor resource
+/// cycles. The reciprocal block throughput is computed as the MAX between:
+/// - NumMicroOps / DispatchWidth
+/// - ProcResourceCycles / #ProcResourceUnits (for every consumed resource).
+double computeBlockRThroughput(const llvm::MCSchedModel &SM,
+ unsigned DispatchWidth, unsigned NumMicroOps,
+ llvm::ArrayRef<unsigned> ProcResourceUsage);
} // namespace mca
#endif
OpenPOWER on IntegriCloud