summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MCA
diff options
context:
space:
mode:
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>2019-06-14 13:31:21 +0000
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>2019-06-14 13:31:21 +0000
commit6b78e4d0a43b780311cfff3b7023fd94fc247748 (patch)
tree986d28ea70b989a92b8d8ec5a36430935a2d75bb /llvm/lib/MCA
parent3062e87a1e563c01fa7cfffc2eb7bbc1c828a80a (diff)
downloadbcm5719-llvm-6b78e4d0a43b780311cfff3b7023fd94fc247748.tar.gz
bcm5719-llvm-6b78e4d0a43b780311cfff3b7023fd94fc247748.zip
[MCA] Ignore invalid processor resource writes of zero cycles. NFCI
In debug mode, the tool also raises a warning and prints out a message which helps identify the problematic MCWriteProcResEntry from the scheduling class. This message would have been useful to have when triaging PR42282. llvm-svn: 363387
Diffstat (limited to 'llvm/lib/MCA')
-rw-r--r--llvm/lib/MCA/InstrBuilder.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/llvm/lib/MCA/InstrBuilder.cpp b/llvm/lib/MCA/InstrBuilder.cpp
index 3aaed0e3e94..829920366c9 100644
--- a/llvm/lib/MCA/InstrBuilder.cpp
+++ b/llvm/lib/MCA/InstrBuilder.cpp
@@ -65,6 +65,17 @@ static void initializeUsedResources(InstrDesc &ID,
for (unsigned I = 0, E = SCDesc.NumWriteProcResEntries; I < E; ++I) {
const MCWriteProcResEntry *PRE = STI.getWriteProcResBegin(&SCDesc) + I;
const MCProcResourceDesc &PR = *SM.getProcResource(PRE->ProcResourceIdx);
+ if (!PRE->Cycles) {
+#ifndef NDEBUG
+ WithColor::warning()
+ << "Ignoring invalid write of zero cycles on processor resource "
+ << PR.Name << "\n";
+ WithColor::note() << "found in scheduling class " << SCDesc.Name
+ << " (write index #" << I << ")\n";
+#endif
+ continue;
+ }
+
uint64_t Mask = ProcResourceMasks[PRE->ProcResourceIdx];
if (PR.BufferSize < 0) {
AllInOrderResources = false;
@@ -189,8 +200,9 @@ static void initializeUsedResources(InstrDesc &ID,
<< "cy=" << R.second.size() << '\n';
for (const uint64_t R : ID.Buffers)
dbgs() << "\t\tBuffer Mask=" << format_hex(R, 16) << '\n';
- dbgs() << "\t\t Used Units=" << format_hex(ID.UsedProcResUnits, 16) << '\n';
- dbgs() << "\t\tUsed Groups=" << format_hex(ID.UsedProcResGroups, 16) << '\n';
+ dbgs() << "\t\t Used Units=" << format_hex(ID.UsedProcResUnits, 16) << '\n';
+ dbgs() << "\t\tUsed Groups=" << format_hex(ID.UsedProcResGroups, 16)
+ << '\n';
});
}
OpenPOWER on IntegriCloud