forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
09e7db9
commit 135033b
Showing
7 changed files
with
137 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#include "V810InstructionSelector.h" | ||
#include "llvm/CodeGen/GlobalISel/GIMatchTableExecutorImpl.h" | ||
#include "llvm/CodeGen/GlobalISel/MachineIRBuilder.h" | ||
|
||
using namespace llvm; | ||
|
||
#define DEBUG_TYPE "v810-isel" | ||
|
||
namespace { | ||
|
||
#define GET_GLOBALISEL_PREDICATE_BITSET | ||
#include "V810GenGlobalISel.inc" | ||
#undef GET_GLOBALISEL_PREDICATE_BITSET | ||
|
||
class V810InstructionSelector : public InstructionSelector { | ||
public: | ||
V810InstructionSelector(const V810TargetMachine &TM, | ||
V810Subtarget &STI, | ||
V810RegisterBankInfo &RBI); | ||
bool select(MachineInstr &MI) override; | ||
static const char *getName() { return DEBUG_TYPE; } | ||
private: | ||
const V810Subtarget &STI; | ||
const V810InstrInfo &TII; | ||
const V810RegisterInfo &TRI; | ||
const V810RegisterBankInfo &RBI; | ||
|
||
/// tblgen-erated 'select' implementation, used as the initial selector for | ||
/// the patterns that don't require complex C++. | ||
bool selectImpl(MachineInstr &MI, CodeGenCoverage &CoverageInfo) const; | ||
|
||
#define GET_GLOBALISEL_PREDICATES_DECL | ||
#include "V810GenGlobalISel.inc" | ||
#undef GET_GLOBALISEL_PREDICATES_DECL | ||
|
||
#define GET_GLOBALISEL_TEMPORARIES_DECL | ||
#include "V810GenGlobalISel.inc" | ||
#undef GET_GLOBALISEL_TEMPORARIES_DECL | ||
}; | ||
|
||
} // namespace | ||
|
||
#define GET_GLOBALISEL_IMPL | ||
#include "V810GenGlobalISel.inc" | ||
#undef GET_GLOBALISEL_IMPL | ||
|
||
V810InstructionSelector::V810InstructionSelector(const V810TargetMachine &TM, | ||
V810Subtarget &STI, | ||
V810RegisterBankInfo &RBI) | ||
: STI(STI), TII(*STI.getInstrInfo()), TRI(*STI.getRegisterInfo()), RBI(RBI), | ||
#define GET_GLOBALISEL_PREDICATES_INIT | ||
#include "V810GenGlobalISel.inc" | ||
#undef GET_GLOBALISEL_PREDICATES_INIT | ||
#define GET_GLOBALISEL_TEMPORARIES_INIT | ||
#include "V810GenGlobalISel.inc" | ||
#undef GET_GLOBALISEL_TEMPORARIES_INIT | ||
{ | ||
} | ||
|
||
bool V810InstructionSelector::select(MachineInstr &MI) { | ||
return selectImpl(MI, *CoverageInfo); | ||
} | ||
|
||
InstructionSelector *llvm::createV810InstructionSelector( | ||
const V810TargetMachine &TM, V810Subtarget &STI, V810RegisterBankInfo &RBI) { | ||
return new V810InstructionSelector(TM, STI, RBI); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#ifndef LLVM_LIB_TARGET_V810_V810INSTRUCTIONSELECTOR_H | ||
#define LLVM_LIB_TARGET_V810_V810INSTRUCTIONSELECTOR_H | ||
|
||
#include "V810RegisterBankInfo.h" | ||
#include "V810Subtarget.h" | ||
#include "V810TargetMachine.h" | ||
#include "llvm/CodeGen/GlobalISel/InstructionSelector.h" | ||
|
||
namespace llvm { | ||
|
||
InstructionSelector * | ||
createV810InstructionSelector(const V810TargetMachine &TM, | ||
V810Subtarget &STI, | ||
V810RegisterBankInfo &RBI); | ||
|
||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#include "V810LegalizerInfo.h" | ||
#include "V810Subtarget.h" | ||
|
||
using namespace llvm; | ||
|
||
V810LegalizerInfo::V810LegalizerInfo(const V810Subtarget &STI) { | ||
getLegacyLegalizerInfo().computeTables(); | ||
verify(*STI.getInstrInfo()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#ifndef LLVM_LIB_TARGET_V810_V810LEGALIZERINFO_H | ||
#define LLVM_LIB_TARGET_V810_V810LEGALIZERINFO_H | ||
|
||
#include "llvm/CodeGen/GlobalISel/LegalizerInfo.h" | ||
|
||
namespace llvm { | ||
|
||
class V810Subtarget; | ||
|
||
class V810LegalizerInfo : public LegalizerInfo { | ||
public: | ||
V810LegalizerInfo(const V810Subtarget &STI); | ||
}; | ||
|
||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters