aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/Mips/MipsSubtarget.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Target/Mips/MipsSubtarget.h')
-rw-r--r--lib/Target/Mips/MipsSubtarget.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/lib/Target/Mips/MipsSubtarget.h b/lib/Target/Mips/MipsSubtarget.h
index 8b10b0596e0e..676d702ba63e 100644
--- a/lib/Target/Mips/MipsSubtarget.h
+++ b/lib/Target/Mips/MipsSubtarget.h
@@ -20,6 +20,10 @@
#include "MipsInstrInfo.h"
#include "llvm/CodeGen/SelectionDAGTargetInfo.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
+#include "llvm/CodeGen/GlobalISel/CallLowering.h"
+#include "llvm/CodeGen/GlobalISel/LegalizerInfo.h"
+#include "llvm/CodeGen/GlobalISel/RegisterBankInfo.h"
+#include "llvm/CodeGen/GlobalISel/InstructionSelector.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/MC/MCInstrItineraries.h"
#include "llvm/Support/ErrorHandling.h"
@@ -44,6 +48,21 @@ class MipsSubtarget : public MipsGenSubtargetInfo {
enum class CPU { P5600 };
+ // Used to avoid printing dsp warnings multiple times.
+ static bool DspWarningPrinted;
+
+ // Used to avoid printing msa warnings multiple times.
+ static bool MSAWarningPrinted;
+
+ // Used to avoid printing crc warnings multiple times.
+ static bool CRCWarningPrinted;
+
+ // Used to avoid printing ginv warnings multiple times.
+ static bool GINVWarningPrinted;
+
+ // Used to avoid printing virt warnings multiple times.
+ static bool VirtWarningPrinted;
+
// Mips architecture version
MipsArchEnum MipsArchVersion;
@@ -152,6 +171,19 @@ class MipsSubtarget : public MipsGenSubtargetInfo {
// HasMT -- support MT ASE.
bool HasMT;
+ // HasCRC -- supports R6 CRC ASE
+ bool HasCRC;
+
+ // HasVirt -- supports Virtualization ASE
+ bool HasVirt;
+
+ // HasGINV -- supports R6 Global INValidate ASE
+ bool HasGINV;
+
+ // Use hazard variants of the jump register instructions for indirect
+ // function calls and jump tables.
+ bool UseIndirectJumpsHazard;
+
// Disable use of the `jal` instruction.
bool UseLongCalls = false;
@@ -272,6 +304,12 @@ public:
bool disableMadd4() const { return DisableMadd4; }
bool hasEVA() const { return HasEVA; }
bool hasMT() const { return HasMT; }
+ bool hasCRC() const { return HasCRC; }
+ bool hasVirt() const { return HasVirt; }
+ bool hasGINV() const { return HasGINV; }
+ bool useIndirectJumpsHazard() const {
+ return UseIndirectJumpsHazard && hasMips32r2();
+ }
bool useSmallSection() const { return UseSmallSection; }
bool hasStandardEncoding() const { return !inMips16Mode(); }
@@ -336,6 +374,19 @@ public:
const InstrItineraryData *getInstrItineraryData() const override {
return &InstrItins;
}
+
+protected:
+ // GlobalISel related APIs.
+ std::unique_ptr<CallLowering> CallLoweringInfo;
+ std::unique_ptr<LegalizerInfo> Legalizer;
+ std::unique_ptr<RegisterBankInfo> RegBankInfo;
+ std::unique_ptr<InstructionSelector> InstSelector;
+
+public:
+ const CallLowering *getCallLowering() const override;
+ const LegalizerInfo *getLegalizerInfo() const override;
+ const RegisterBankInfo *getRegBankInfo() const override;
+ const InstructionSelector *getInstructionSelector() const override;
};
} // End llvm namespace