[PATCH] D139350: [AVR] Register AVRDAGToDAGISel pass with the pass manager
Ievgenii Meshcheriakov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 5 11:14:06 PST 2022
eugmes created this revision.
eugmes added a reviewer: dylanmckay.
eugmes added a project: LLVM.
Herald added subscribers: Jim, hiraditya.
Herald added a project: All.
eugmes requested review of this revision.
This makes it possible to see the output from the pass when using --print-after-all and other command line options.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D139350
Files:
llvm/lib/Target/AVR/AVR.h
llvm/lib/Target/AVR/AVRISelDAGToDAG.cpp
llvm/lib/Target/AVR/AVRTargetMachine.cpp
Index: llvm/lib/Target/AVR/AVRTargetMachine.cpp
===================================================================
--- llvm/lib/Target/AVR/AVRTargetMachine.cpp
+++ llvm/lib/Target/AVR/AVRTargetMachine.cpp
@@ -93,6 +93,7 @@
RegisterTargetMachine<AVRTargetMachine> X(getTheAVRTarget());
auto &PR = *PassRegistry::getPassRegistry();
+ initializeAVRDAGToDAGISelPass(PR);
initializeAVRExpandPseudoPass(PR);
initializeAVRShiftExpandPass(PR);
}
Index: llvm/lib/Target/AVR/AVRISelDAGToDAG.cpp
===================================================================
--- llvm/lib/Target/AVR/AVRISelDAGToDAG.cpp
+++ llvm/lib/Target/AVR/AVRISelDAGToDAG.cpp
@@ -26,8 +26,9 @@
/// Lowers LLVM IR (in DAG form) to AVR MC instructions (in DAG form).
class AVRDAGToDAGISel : public SelectionDAGISel {
public:
- AVRDAGToDAGISel(AVRTargetMachine &TM, CodeGenOpt::Level OptLevel)
- : SelectionDAGISel(TM, OptLevel), Subtarget(nullptr) {}
+ explicit AVRDAGToDAGISel(AVRTargetMachine *TM = nullptr,
+ CodeGenOpt::Level OptLevel = CodeGenOpt::Default)
+ : SelectionDAGISel(*TM, OptLevel), Subtarget(nullptr) {}
StringRef getPassName() const override {
return "AVR DAG->DAG Instruction Selection";
@@ -577,7 +578,12 @@
FunctionPass *createAVRISelDag(AVRTargetMachine &TM,
CodeGenOpt::Level OptLevel) {
- return new AVRDAGToDAGISel(TM, OptLevel);
+ return new AVRDAGToDAGISel(&TM, OptLevel);
}
} // end of namespace llvm
+
+using namespace llvm;
+
+INITIALIZE_PASS(AVRDAGToDAGISel, "avr-isel",
+ "AVR DAG->DAG Instruction Selection", false, false)
Index: llvm/lib/Target/AVR/AVR.h
===================================================================
--- llvm/lib/Target/AVR/AVR.h
+++ llvm/lib/Target/AVR/AVR.h
@@ -31,6 +31,7 @@
FunctionPass *createAVRFrameAnalyzerPass();
FunctionPass *createAVRBranchSelectionPass();
+void initializeAVRDAGToDAGISelPass(PassRegistry &);
void initializeAVRShiftExpandPass(PassRegistry &);
void initializeAVRExpandPseudoPass(PassRegistry &);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139350.480168.patch
Type: text/x-patch
Size: 2076 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221205/cffee4ea/attachment.bin>
More information about the llvm-commits
mailing list