diff options
| author | Anton Korobeynikov <asl@math.spbu.ru> | 2009-05-03 12:57:15 +0000 |
|---|---|---|
| committer | Anton Korobeynikov <asl@math.spbu.ru> | 2009-05-03 12:57:15 +0000 |
| commit | 101380015cc17edf535fe2761bd20f02353ca6a0 (patch) | |
| tree | 46ed7d13517e21a5ba98ab3348de4153ac53725a /llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp | |
| parent | 7bee4158361dc79003edae810db0a6b9e49e23a5 (diff) | |
| download | bcm5719-llvm-101380015cc17edf535fe2761bd20f02353ca6a0.tar.gz bcm5719-llvm-101380015cc17edf535fe2761bd20f02353ca6a0.zip | |
Dummy MSP430 backend
llvm-svn: 70694
Diffstat (limited to 'llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp')
| -rw-r--r-- | llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp b/llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp new file mode 100644 index 00000000000..eefc1a0b88e --- /dev/null +++ b/llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp @@ -0,0 +1,84 @@ +//===-- MSP430ISelDAGToDAG.cpp - A dag to dag inst selector for MSP430 ----===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file defines an instruction selector for the MSP430 target. +// +//===----------------------------------------------------------------------===// + +#include "MSP430.h" +#include "MSP430ISelLowering.h" +#include "MSP430TargetMachine.h" +#include "llvm/DerivedTypes.h" +#include "llvm/Function.h" +#include "llvm/Intrinsics.h" +#include "llvm/CallingConv.h" +#include "llvm/Constants.h" +#include "llvm/CodeGen/MachineFrameInfo.h" +#include "llvm/CodeGen/MachineFunction.h" +#include "llvm/CodeGen/MachineInstrBuilder.h" +#include "llvm/CodeGen/MachineRegisterInfo.h" +#include "llvm/CodeGen/SelectionDAG.h" +#include "llvm/CodeGen/SelectionDAGISel.h" +#include "llvm/Target/TargetLowering.h" +#include "llvm/Support/Compiler.h" +#include "llvm/Support/Debug.h" +#include <queue> +#include <set> +using namespace llvm; + +/// MSP430DAGToDAGISel - MSP430 specific code to select MSP430 machine +/// instructions for SelectionDAG operations. +/// +namespace { + class MSP430DAGToDAGISel : public SelectionDAGISel { + MSP430TargetLowering &Lowering; + const MSP430Subtarget &Subtarget; + + public: + MSP430DAGToDAGISel(MSP430TargetMachine &TM) + : SelectionDAGISel(TM), + Lowering(*TM.getTargetLowering()), + Subtarget(*TM.getSubtargetImpl()) { } + + virtual void InstructionSelect(); + + virtual const char *getPassName() const { + return "MSP430 DAG->DAG Pattern Instruction Selection"; + } + + // Include the pieces autogenerated from the target description. + #include "MSP430GenDAGISel.inc" + + private: + SDNode *Select(SDValue Op); + }; +} // end anonymous namespace + +/// createMSP430ISelDag - This pass converts a legalized DAG into a +/// MSP430-specific DAG, ready for instruction scheduling. +/// +FunctionPass *llvm::createMSP430ISelDag(MSP430TargetMachine &TM) { + return new MSP430DAGToDAGISel(TM); +} + +/// InstructionSelect - This callback is invoked by +/// SelectionDAGISel when it has created a SelectionDAG for us to codegen. +void MSP430DAGToDAGISel:: +InstructionSelect() { + DEBUG(BB->dump()); + + // Select target instructions for the DAG. + SelectRoot(*CurDAG); + + CurDAG->RemoveDeadNodes(); +} + +SDNode *MSP430DAGToDAGISel::Select(SDValue Op) { + return SelectCode(Op); +} |

