summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-mca
diff options
context:
space:
mode:
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>2018-11-24 18:40:45 +0000
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>2018-11-24 18:40:45 +0000
commit42720603c44a398b0ffeeecf8d15dc9adf808e17 (patch)
tree331fe0ac6f015347fd0a100a05d8d78942cd37eb /llvm/tools/llvm-mca
parente0466f570e6cd170f74da8e8557e9e511f7c10c0 (diff)
downloadbcm5719-llvm-42720603c44a398b0ffeeecf8d15dc9adf808e17.tar.gz
bcm5719-llvm-42720603c44a398b0ffeeecf8d15dc9adf808e17.zip
[llvm-mca] InstrBuilder: warnings for call/ret instructions are only reported once.
llvm-svn: 347514
Diffstat (limited to 'llvm/tools/llvm-mca')
-rw-r--r--llvm/tools/llvm-mca/include/InstrBuilder.h9
-rw-r--r--llvm/tools/llvm-mca/lib/InstrBuilder.cpp9
2 files changed, 14 insertions, 4 deletions
diff --git a/llvm/tools/llvm-mca/include/InstrBuilder.h b/llvm/tools/llvm-mca/include/InstrBuilder.h
index 5f6adead105..1c958c5020e 100644
--- a/llvm/tools/llvm-mca/include/InstrBuilder.h
+++ b/llvm/tools/llvm-mca/include/InstrBuilder.h
@@ -46,6 +46,9 @@ class InstrBuilder {
DenseMap<unsigned short, std::unique_ptr<const InstrDesc>> Descriptors;
DenseMap<const MCInst *, std::unique_ptr<const InstrDesc>> VariantDescriptors;
+ bool FirstCallInst;
+ bool FirstReturnInst;
+
Expected<const InstrDesc &> createInstrDescImpl(const MCInst &MCI);
Expected<const InstrDesc &> getOrCreateInstrDesc(const MCInst &MCI);
@@ -60,7 +63,11 @@ public:
InstrBuilder(const MCSubtargetInfo &STI, const MCInstrInfo &MCII,
const MCRegisterInfo &RI, const MCInstrAnalysis &IA);
- void clear() { VariantDescriptors.shrink_and_clear(); }
+ void clear() {
+ VariantDescriptors.shrink_and_clear();
+ FirstCallInst = true;
+ FirstReturnInst = true;
+ }
Expected<std::unique_ptr<Instruction>> createInstruction(const MCInst &MCI);
};
diff --git a/llvm/tools/llvm-mca/lib/InstrBuilder.cpp b/llvm/tools/llvm-mca/lib/InstrBuilder.cpp
index b6c6a01d5ed..f691f466640 100644
--- a/llvm/tools/llvm-mca/lib/InstrBuilder.cpp
+++ b/llvm/tools/llvm-mca/lib/InstrBuilder.cpp
@@ -29,7 +29,8 @@ InstrBuilder::InstrBuilder(const llvm::MCSubtargetInfo &sti,
const llvm::MCInstrInfo &mcii,
const llvm::MCRegisterInfo &mri,
const llvm::MCInstrAnalysis &mcia)
- : STI(sti), MCII(mcii), MRI(mri), MCIA(mcia) {
+ : STI(sti), MCII(mcii), MRI(mri), MCIA(mcia), FirstCallInst(true),
+ FirstReturnInst(true) {
computeProcResourceMasks(STI.getSchedModel(), ProcResourceMasks);
}
@@ -455,17 +456,19 @@ InstrBuilder::createInstrDescImpl(const MCInst &MCI) {
std::unique_ptr<InstrDesc> ID = llvm::make_unique<InstrDesc>();
ID->NumMicroOps = SCDesc.NumMicroOps;
- if (MCDesc.isCall()) {
+ if (MCDesc.isCall() && FirstCallInst) {
// We don't correctly model calls.
WithColor::warning() << "found a call in the input assembly sequence.\n";
WithColor::note() << "call instructions are not correctly modeled. "
<< "Assume a latency of 100cy.\n";
+ FirstCallInst = false;
}
- if (MCDesc.isReturn()) {
+ if (MCDesc.isReturn() && FirstReturnInst) {
WithColor::warning() << "found a return instruction in the input"
<< " assembly sequence.\n";
WithColor::note() << "program counter updates are ignored.\n";
+ FirstReturnInst = false;
}
ID->MayLoad = MCDesc.mayLoad();
OpenPOWER on IntegriCloud