diff options
author | paperchalice <liujunchang97@outlook.com> | 2024-06-02 09:12:33 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-02 09:12:33 +0800 |
commit | d2cdc8ab45d74f8691f73cb5a2b8c431585cd449 (patch) | |
tree | 0aa5cbc5236038b0496289d33c037714bf767c32 /llvm/lib/Target/XCore | |
parent | 0310f7f2d0c56a5697710251cec9803cbf7b4d56 (diff) | |
download | llvm-d2cdc8ab45d74f8691f73cb5a2b8c431585cd449.zip llvm-d2cdc8ab45d74f8691f73cb5a2b8c431585cd449.tar.gz llvm-d2cdc8ab45d74f8691f73cb5a2b8c431585cd449.tar.bz2 |
[NewPM][CodeGen] Port selection dag isel to new pass manager (#83567)
Port selection dag isel to new pass manager.
Only `AMDGPU` and `X86` support new pass version. `-verify-machineinstrs` in new pass manager belongs to verify instrumentation, it is enabled by default.
Diffstat (limited to 'llvm/lib/Target/XCore')
-rw-r--r-- | llvm/lib/Target/XCore/XCore.h | 2 | ||||
-rw-r--r-- | llvm/lib/Target/XCore/XCoreISelDAGToDAG.cpp | 19 | ||||
-rw-r--r-- | llvm/lib/Target/XCore/XCoreTargetMachine.cpp | 2 |
3 files changed, 15 insertions, 8 deletions
diff --git a/llvm/lib/Target/XCore/XCore.h b/llvm/lib/Target/XCore/XCore.h index f019fa4..ad50f05 100644 --- a/llvm/lib/Target/XCore/XCore.h +++ b/llvm/lib/Target/XCore/XCore.h @@ -31,7 +31,7 @@ namespace llvm { FunctionPass *createXCoreISelDag(XCoreTargetMachine &TM, CodeGenOptLevel OptLevel); ModulePass *createXCoreLowerThreadLocalPass(); - void initializeXCoreDAGToDAGISelPass(PassRegistry &); + void initializeXCoreDAGToDAGISelLegacyPass(PassRegistry &); } // end namespace llvm; diff --git a/llvm/lib/Target/XCore/XCoreISelDAGToDAG.cpp b/llvm/lib/Target/XCore/XCoreISelDAGToDAG.cpp index 1535eb6..dcbf114 100644 --- a/llvm/lib/Target/XCore/XCoreISelDAGToDAG.cpp +++ b/llvm/lib/Target/XCore/XCoreISelDAGToDAG.cpp @@ -41,12 +41,10 @@ namespace { class XCoreDAGToDAGISel : public SelectionDAGISel { public: - static char ID; - XCoreDAGToDAGISel() = delete; XCoreDAGToDAGISel(XCoreTargetMachine &TM, CodeGenOptLevel OptLevel) - : SelectionDAGISel(ID, TM, OptLevel) {} + : SelectionDAGISel(TM, OptLevel) {} void Select(SDNode *N) override; bool tryBRIND(SDNode *N); @@ -78,18 +76,27 @@ namespace { // Include the pieces autogenerated from the target description. #include "XCoreGenDAGISel.inc" }; + + class XCoreDAGToDAGISelLegacy : public SelectionDAGISelLegacy { + public: + static char ID; + explicit XCoreDAGToDAGISelLegacy(XCoreTargetMachine &TM, + CodeGenOptLevel OptLevel) + : SelectionDAGISelLegacy( + ID, std::make_unique<XCoreDAGToDAGISel>(TM, OptLevel)) {} + }; } // end anonymous namespace -char XCoreDAGToDAGISel::ID = 0; +char XCoreDAGToDAGISelLegacy::ID = 0; -INITIALIZE_PASS(XCoreDAGToDAGISel, DEBUG_TYPE, PASS_NAME, false, false) +INITIALIZE_PASS(XCoreDAGToDAGISelLegacy, DEBUG_TYPE, PASS_NAME, false, false) /// createXCoreISelDag - This pass converts a legalized DAG into a /// XCore-specific DAG, ready for instruction scheduling. /// FunctionPass *llvm::createXCoreISelDag(XCoreTargetMachine &TM, CodeGenOptLevel OptLevel) { - return new XCoreDAGToDAGISel(TM, OptLevel); + return new XCoreDAGToDAGISelLegacy(TM, OptLevel); } bool XCoreDAGToDAGISel::SelectADDRspii(SDValue Addr, SDValue &Base, diff --git a/llvm/lib/Target/XCore/XCoreTargetMachine.cpp b/llvm/lib/Target/XCore/XCoreTargetMachine.cpp index 374e91d..bb5beef 100644 --- a/llvm/lib/Target/XCore/XCoreTargetMachine.cpp +++ b/llvm/lib/Target/XCore/XCoreTargetMachine.cpp @@ -107,7 +107,7 @@ void XCorePassConfig::addPreEmitPass() { extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeXCoreTarget() { RegisterTargetMachine<XCoreTargetMachine> X(getTheXCoreTarget()); PassRegistry &PR = *PassRegistry::getPassRegistry(); - initializeXCoreDAGToDAGISelPass(PR); + initializeXCoreDAGToDAGISelLegacyPass(PR); } TargetTransformInfo |