summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-mca/InstrBuilder.h
diff options
context:
space:
mode:
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>2018-07-09 12:30:55 +0000
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>2018-07-09 12:30:55 +0000
commit88347796440212e7acd97b4e675c568ce5cf1d53 (patch)
tree6e211e16fbb249acd31f865ff7fc40d5663246ab /llvm/tools/llvm-mca/InstrBuilder.h
parent7e4234fc9743056ca87defd2c7d050826ceba4e0 (diff)
downloadbcm5719-llvm-88347796440212e7acd97b4e675c568ce5cf1d53.tar.gz
bcm5719-llvm-88347796440212e7acd97b4e675c568ce5cf1d53.zip
[llvm-mca] report an error if the assembly sequence contains an unsupported instruction.
This is a short-term fix for PR38093. For now, we llvm::report_fatal_error if the instruction builder finds an unsupported instruction in the instruction stream. We need to revisit this fix once we start addressing PR38101. Essentially, we need a better framework for error handling. llvm-svn: 336543
Diffstat (limited to 'llvm/tools/llvm-mca/InstrBuilder.h')
-rw-r--r--llvm/tools/llvm-mca/InstrBuilder.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/llvm/tools/llvm-mca/InstrBuilder.h b/llvm/tools/llvm-mca/InstrBuilder.h
index e5e80d7cf79..69a53b6fec2 100644
--- a/llvm/tools/llvm-mca/InstrBuilder.h
+++ b/llvm/tools/llvm-mca/InstrBuilder.h
@@ -17,6 +17,7 @@
#include "Instruction.h"
#include "Support.h"
+#include "llvm/MC/MCInstPrinter.h"
#include "llvm/MC/MCInstrAnalysis.h"
#include "llvm/MC/MCInstrInfo.h"
#include "llvm/MC/MCRegisterInfo.h"
@@ -41,6 +42,7 @@ class InstrBuilder {
const llvm::MCInstrInfo &MCII;
const llvm::MCRegisterInfo &MRI;
const llvm::MCInstrAnalysis &MCIA;
+ llvm::MCInstPrinter &MCIP;
llvm::SmallVector<uint64_t, 8> ProcResourceMasks;
llvm::DenseMap<unsigned short, std::unique_ptr<const InstrDesc>> Descriptors;
@@ -51,11 +53,16 @@ class InstrBuilder {
InstrBuilder(const InstrBuilder &) = delete;
InstrBuilder &operator=(const InstrBuilder &) = delete;
+ void populateWrites(InstrDesc &ID, const llvm::MCInst &MCI,
+ unsigned SchedClassID);
+ void populateReads(InstrDesc &ID, const llvm::MCInst &MCI,
+ unsigned SchedClassID);
+
public:
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),
+ const llvm::MCInstrAnalysis &mcia, llvm::MCInstPrinter &mcip)
+ : STI(sti), MCII(mcii), MRI(mri), MCIA(mcia), MCIP(mcip),
ProcResourceMasks(STI.getSchedModel().getNumProcResourceKinds()) {
computeProcResourceMasks(STI.getSchedModel(), ProcResourceMasks);
}
OpenPOWER on IntegriCloud