summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-mca
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-mca')
-rw-r--r--llvm/tools/llvm-mca/HWEventListener.h4
-rw-r--r--llvm/tools/llvm-mca/Scheduler.cpp11
-rw-r--r--llvm/tools/llvm-mca/Scheduler.h4
3 files changed, 10 insertions, 9 deletions
diff --git a/llvm/tools/llvm-mca/HWEventListener.h b/llvm/tools/llvm-mca/HWEventListener.h
index 5ef64beb136..a7949121595 100644
--- a/llvm/tools/llvm-mca/HWEventListener.h
+++ b/llvm/tools/llvm-mca/HWEventListener.h
@@ -61,11 +61,11 @@ class HWInstructionIssuedEvent : public HWInstructionEvent {
public:
using ResourceRef = std::pair<uint64_t, uint64_t>;
HWInstructionIssuedEvent(unsigned Index,
- llvm::ArrayRef<std::pair<ResourceRef, unsigned>> UR)
+ llvm::ArrayRef<std::pair<ResourceRef, double>> UR)
: HWInstructionEvent(HWInstructionEvent::Issued, Index),
UsedResources(UR) {}
- llvm::ArrayRef<std::pair<ResourceRef, unsigned>> UsedResources;
+ llvm::ArrayRef<std::pair<ResourceRef, double>> UsedResources;
};
class HWInstructionDispatchedEvent : public HWInstructionEvent {
diff --git a/llvm/tools/llvm-mca/Scheduler.cpp b/llvm/tools/llvm-mca/Scheduler.cpp
index 08ddf6ebe7d..05656246bfe 100644
--- a/llvm/tools/llvm-mca/Scheduler.cpp
+++ b/llvm/tools/llvm-mca/Scheduler.cpp
@@ -11,9 +11,9 @@
//
//===----------------------------------------------------------------------===//
+#include "Scheduler.h"
#include "Backend.h"
#include "HWEventListener.h"
-#include "Scheduler.h"
#include "Support.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
@@ -180,7 +180,7 @@ bool ResourceManager::mustIssueImmediately(const InstrDesc &Desc) {
void ResourceManager::issueInstruction(
unsigned Index, const InstrDesc &Desc,
- SmallVectorImpl<std::pair<ResourceRef, unsigned>> &Pipes) {
+ SmallVectorImpl<std::pair<ResourceRef, double>> &Pipes) {
for (const std::pair<uint64_t, ResourceUsage> &R : Desc.Resources) {
const CycleSegment &CS = R.second.CS;
if (!CS.size()) {
@@ -196,7 +196,8 @@ void ResourceManager::issueInstruction(
// Replace the resource mask with a valid processor resource index.
const ResourceState &RS = *Resources[Pipe.first];
Pipe.first = RS.getProcResourceID();
- Pipes.emplace_back(std::pair<ResourceRef, unsigned>(Pipe, CS.size()));
+ Pipes.emplace_back(
+ std::pair<ResourceRef, double>(Pipe, static_cast<double>(CS.size())));
} else {
assert((countPopulation(R.first) > 1) && "Expected a group!");
// Mark this group as reserved.
@@ -338,7 +339,7 @@ void Scheduler::issueInstruction(Instruction &IS, unsigned InstrIndex) {
// two resources). We use a small vector here, and conservatively
// initialize its capacity to 4. This should address the majority of
// the cases.
- SmallVector<std::pair<ResourceRef, unsigned>, 4> UsedResources;
+ SmallVector<std::pair<ResourceRef, double>, 4> UsedResources;
Resources->issueInstruction(InstrIndex, D, UsedResources);
// Notify the instruction that it started executing.
// This updates the internal state of each write.
@@ -417,7 +418,7 @@ void Scheduler::updateIssuedQueue() {
}
void Scheduler::notifyInstructionIssued(
- unsigned Index, ArrayRef<std::pair<ResourceRef, unsigned>> Used) {
+ unsigned Index, ArrayRef<std::pair<ResourceRef, double>> Used) {
DEBUG({
dbgs() << "[E] Instruction Issued: " << Index << '\n';
for (const std::pair<ResourceRef, unsigned> &Resource : Used) {
diff --git a/llvm/tools/llvm-mca/Scheduler.h b/llvm/tools/llvm-mca/Scheduler.h
index 6f677744a38..a3ef14456a3 100644
--- a/llvm/tools/llvm-mca/Scheduler.h
+++ b/llvm/tools/llvm-mca/Scheduler.h
@@ -363,7 +363,7 @@ public:
void issueInstruction(
unsigned Index, const InstrDesc &Desc,
- llvm::SmallVectorImpl<std::pair<ResourceRef, unsigned>> &Pipes);
+ llvm::SmallVectorImpl<std::pair<ResourceRef, double>> &Pipes);
void cycleEvent(llvm::SmallVectorImpl<ResourceRef> &ResourcesFreed);
@@ -420,7 +420,7 @@ class Scheduler {
void notifyInstructionIssued(
unsigned Index,
- llvm::ArrayRef<std::pair<ResourceRef, unsigned>> Used);
+ llvm::ArrayRef<std::pair<ResourceRef, double>> Used);
void notifyInstructionExecuted(unsigned Index);
void notifyInstructionReady(unsigned Index);
void notifyResourceAvailable(const ResourceRef &RR);
OpenPOWER on IntegriCloud