summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>2019-03-26 15:38:37 +0000
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>2019-03-26 15:38:37 +0000
commitddce32e2f3a009b37eb33a5d455c072cefe1d2a0 (patch)
tree3537f3377f8a229c7149999b9079ab81cbac9b96 /llvm
parentbb7c57d36dd6577090e5feb3b29df73770d961ba (diff)
downloadbcm5719-llvm-ddce32e2f3a009b37eb33a5d455c072cefe1d2a0.tar.gz
bcm5719-llvm-ddce32e2f3a009b37eb33a5d455c072cefe1d2a0.zip
[MCA] Correctly update the UsedResourceGroups mask in the InstrBuilder.
Found by inspection when looking at the debug output of MCA. This problem was latent, and none of the upstream models were affected by it. No functional change intended. llvm-svn: 357000
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/MCA/Stages/DispatchStage.h4
-rw-r--r--llvm/lib/MCA/InstrBuilder.cpp1
-rw-r--r--llvm/lib/MCA/Stages/DispatchStage.cpp10
-rw-r--r--llvm/tools/llvm-mca/Views/SummaryView.cpp3
-rw-r--r--llvm/tools/llvm-mca/llvm-mca.cpp8
5 files changed, 16 insertions, 10 deletions
diff --git a/llvm/include/llvm/MCA/Stages/DispatchStage.h b/llvm/include/llvm/MCA/Stages/DispatchStage.h
index e39f03e3263..d80ededeaca 100644
--- a/llvm/include/llvm/MCA/Stages/DispatchStage.h
+++ b/llvm/include/llvm/MCA/Stages/DispatchStage.h
@@ -68,9 +68,7 @@ class DispatchStage final : public Stage {
public:
DispatchStage(const MCSubtargetInfo &Subtarget, const MCRegisterInfo &MRI,
unsigned MaxDispatchWidth, RetireControlUnit &R,
- RegisterFile &F)
- : DispatchWidth(MaxDispatchWidth), AvailableEntries(MaxDispatchWidth),
- CarryOver(0U), CarriedOver(), STI(Subtarget), RCU(R), PRF(F) {}
+ RegisterFile &F);
bool isAvailable(const InstRef &IR) const override;
diff --git a/llvm/lib/MCA/InstrBuilder.cpp b/llvm/lib/MCA/InstrBuilder.cpp
index e10efb28f77..89904e75cc1 100644
--- a/llvm/lib/MCA/InstrBuilder.cpp
+++ b/llvm/lib/MCA/InstrBuilder.cpp
@@ -115,6 +115,7 @@ static void initializeUsedResources(InstrDesc &ID,
} else {
// Remove the leading 1 from the resource group mask.
NormalizedMask ^= PowerOf2Floor(NormalizedMask);
+ UsedResourceGroups |= (A.first ^ NormalizedMask);
}
for (unsigned J = I + 1; J < E; ++J) {
diff --git a/llvm/lib/MCA/Stages/DispatchStage.cpp b/llvm/lib/MCA/Stages/DispatchStage.cpp
index ae3d3fd6743..b55ac70307a 100644
--- a/llvm/lib/MCA/Stages/DispatchStage.cpp
+++ b/llvm/lib/MCA/Stages/DispatchStage.cpp
@@ -25,6 +25,16 @@
namespace llvm {
namespace mca {
+DispatchStage::DispatchStage(const MCSubtargetInfo &Subtarget,
+ const MCRegisterInfo &MRI,
+ unsigned MaxDispatchWidth, RetireControlUnit &R,
+ RegisterFile &F)
+ : DispatchWidth(MaxDispatchWidth), AvailableEntries(MaxDispatchWidth),
+ CarryOver(0U), CarriedOver(), STI(Subtarget), RCU(R), PRF(F) {
+ if (!DispatchWidth)
+ DispatchWidth = Subtarget.getSchedModel().IssueWidth;
+}
+
void DispatchStage::notifyInstructionDispatched(const InstRef &IR,
ArrayRef<unsigned> UsedRegs,
unsigned UOps) const {
diff --git a/llvm/tools/llvm-mca/Views/SummaryView.cpp b/llvm/tools/llvm-mca/Views/SummaryView.cpp
index e3d85507dc8..5aa53b2df90 100644
--- a/llvm/tools/llvm-mca/Views/SummaryView.cpp
+++ b/llvm/tools/llvm-mca/Views/SummaryView.cpp
@@ -24,7 +24,8 @@ namespace mca {
SummaryView::SummaryView(const MCSchedModel &Model, ArrayRef<MCInst> S,
unsigned Width, bool EmitBottleneckAnalysis)
- : SM(Model), Source(S), DispatchWidth(Width), LastInstructionIdx(0),
+ : SM(Model), Source(S), DispatchWidth(Width?Width: Model.IssueWidth),
+ LastInstructionIdx(0),
TotalCycles(0), NumMicroOps(0), BPI({0, 0, 0, 0, 0}),
ResourcePressureDistribution(Model.getNumProcResourceKinds(), 0),
ProcResourceUsage(Model.getNumProcResourceKinds(), 0),
diff --git a/llvm/tools/llvm-mca/llvm-mca.cpp b/llvm/tools/llvm-mca/llvm-mca.cpp
index 17b19d1818f..ce253af1fe7 100644
--- a/llvm/tools/llvm-mca/llvm-mca.cpp
+++ b/llvm/tools/llvm-mca/llvm-mca.cpp
@@ -381,17 +381,13 @@ int main(int argc, char **argv) {
const MCSchedModel &SM = STI->getSchedModel();
- unsigned Width = SM.IssueWidth;
- if (DispatchWidth)
- Width = DispatchWidth;
-
// Create an instruction builder.
mca::InstrBuilder IB(*STI, *MCII, *MRI, MCIA.get());
// Create a context to control ownership of the pipeline hardware.
mca::Context MCA(*MRI, *STI);
- mca::PipelineOptions PO(Width, RegisterFileSize, LoadQueueSize,
+ mca::PipelineOptions PO(DispatchWidth, RegisterFileSize, LoadQueueSize,
StoreQueueSize, AssumeNoAlias,
EnableBottleneckAnalysis);
@@ -470,7 +466,7 @@ int main(int argc, char **argv) {
if (PrintSummaryView)
Printer.addView(llvm::make_unique<mca::SummaryView>(
- SM, Insts, Width, EnableBottleneckAnalysis));
+ SM, Insts, DispatchWidth, EnableBottleneckAnalysis));
if (PrintInstructionInfoView)
Printer.addView(
OpenPOWER on IntegriCloud