From 58aa049b9b80e342e3f6769f0834dabf41476bef Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Wed, 27 Jan 2021 13:14:43 -0800 Subject: [PATCH] [RISCV] Move RISCVVPseudosTable from RISCVBaseInfo.h to RISCVInstrInfo.h. NFC RISCVBaseInfo.h belongs to the MC layer, but the Pseudo instructions are only used by the CodeGen layer. So it makes sense to keep this table in the CodeGen layer. --- llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.cpp | 7 ------- llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.h | 15 --------------- llvm/lib/Target/RISCV/RISCVInstrInfo.cpp | 11 +++++++++++ llvm/lib/Target/RISCV/RISCVInstrInfo.h | 12 ++++++++++++ 4 files changed, 23 insertions(+), 22 deletions(-) diff --git a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.cpp b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.cpp index fa36234..3f557f8 100644 --- a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.cpp +++ b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.cpp @@ -94,13 +94,6 @@ void validate(const Triple &TT, const FeatureBitset &FeatureBits) { } // namespace RISCVFeatures -namespace RISCVVPseudosTable { - -#define GET_RISCVVPseudosTable_IMPL -#include "RISCVGenSearchableTables.inc" - -} // namespace RISCVVPseudosTable - void RISCVVType::printVType(unsigned VType, raw_ostream &OS) { RISCVVSEW VSEW = getVSEW(VType); RISCVVLMUL VLMUL = getVLMUL(VType); diff --git a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.h b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.h index ef1af9d..a68dc21 100644 --- a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.h +++ b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.h @@ -329,21 +329,6 @@ void printVType(unsigned VType, raw_ostream &OS); } // namespace RISCVVType -namespace RISCVVPseudosTable { - -struct PseudoInfo { -#include "MCTargetDesc/RISCVBaseInfo.h" - uint16_t Pseudo; - uint16_t BaseInstr; -}; - -using namespace RISCV; - -#define GET_RISCVVPseudosTable_DECL -#include "RISCVGenSearchableTables.inc" - -} // end namespace RISCVVPseudosTable - } // namespace llvm #endif diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp b/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp index 45a5e10..126f743 100644 --- a/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp +++ b/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp @@ -32,6 +32,17 @@ using namespace llvm; #define GET_INSTRINFO_CTOR_DTOR #include "RISCVGenInstrInfo.inc" +namespace llvm { +namespace RISCVVPseudosTable { + +using namespace RISCV; + +#define GET_RISCVVPseudosTable_IMPL +#include "RISCVGenSearchableTables.inc" + +} // namespace RISCVVPseudosTable +} // namespace llvm + RISCVInstrInfo::RISCVInstrInfo(RISCVSubtarget &STI) : RISCVGenInstrInfo(RISCV::ADJCALLSTACKDOWN, RISCV::ADJCALLSTACKUP), STI(STI) {} diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfo.h b/llvm/lib/Target/RISCV/RISCVInstrInfo.h index 0b03421..3a21e60 100644 --- a/llvm/lib/Target/RISCV/RISCVInstrInfo.h +++ b/llvm/lib/Target/RISCV/RISCVInstrInfo.h @@ -137,5 +137,17 @@ protected: const RISCVSubtarget &STI; }; +namespace RISCVVPseudosTable { + +struct PseudoInfo { + uint16_t Pseudo; + uint16_t BaseInstr; +}; + +#define GET_RISCVVPseudosTable_DECL +#include "RISCVGenSearchableTables.inc" + +} // end namespace RISCVVPseudosTable + } // end namespace llvm #endif -- 2.7.4