summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>2018-12-17 14:27:33 +0000
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>2018-12-17 14:27:33 +0000
commit4c737110696521478ccd3e7dbb729ad9500fd6c5 (patch)
treea31819f59e8cc6f569f03d03797b7c5213dbdab1 /llvm/lib
parent6c933a2bed30be7009b1994d112e188343d40265 (diff)
downloadbcm5719-llvm-4c737110696521478ccd3e7dbb729ad9500fd6c5.tar.gz
bcm5719-llvm-4c737110696521478ccd3e7dbb729ad9500fd6c5.zip
[MCA] Add support for BeginGroup/EndGroup.
llvm-svn: 349354
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/MCA/InstrBuilder.cpp2
-rw-r--r--llvm/lib/MCA/Stages/DispatchStage.cpp8
2 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/MCA/InstrBuilder.cpp b/llvm/lib/MCA/InstrBuilder.cpp
index cd3b815c3a6..8d501dc6b15 100644
--- a/llvm/lib/MCA/InstrBuilder.cpp
+++ b/llvm/lib/MCA/InstrBuilder.cpp
@@ -536,6 +536,8 @@ InstrBuilder::createInstrDescImpl(const MCInst &MCI) {
ID->MayLoad = MCDesc.mayLoad();
ID->MayStore = MCDesc.mayStore();
ID->HasSideEffects = MCDesc.hasUnmodeledSideEffects();
+ ID->BeginGroup = SCDesc.BeginGroup;
+ ID->EndGroup = SCDesc.EndGroup;
initializeUsedResources(*ID, SCDesc, STI, ProcResourceMasks);
computeMaxLatency(*ID, MCDesc, SCDesc, STI);
diff --git a/llvm/lib/MCA/Stages/DispatchStage.cpp b/llvm/lib/MCA/Stages/DispatchStage.cpp
index 52e04fad58e..7fb4eb6a1c0 100644
--- a/llvm/lib/MCA/Stages/DispatchStage.cpp
+++ b/llvm/lib/MCA/Stages/DispatchStage.cpp
@@ -99,6 +99,10 @@ Error DispatchStage::dispatch(InstRef IR) {
AvailableEntries -= NumMicroOps;
}
+ // Check if this instructions ends the dispatch group.
+ if (Desc.EndGroup)
+ AvailableEntries = 0;
+
// Check if this is an optimizable reg-reg move.
bool IsEliminated = false;
if (IS.isOptimizableMove()) {
@@ -164,6 +168,10 @@ bool DispatchStage::isAvailable(const InstRef &IR) const {
unsigned Required = std::min(Desc.NumMicroOps, DispatchWidth);
if (Required > AvailableEntries)
return false;
+
+ if (Desc.BeginGroup && AvailableEntries != DispatchWidth)
+ return false;
+
// The dispatch logic doesn't internally buffer instructions. It only accepts
// instructions that can be successfully moved to the next stage during this
// same cycle.
OpenPOWER on IntegriCloud