svn commit: r223027 - in projects/llvm-ia64:
contrib/llvm/lib/Target/IA64 lib/clang/libllvmia64codegen
Marcel Moolenaar
marcel at FreeBSD.org
Sun Jun 12 23:45:47 UTC 2011
Author: marcel
Date: Sun Jun 12 23:45:46 2011
New Revision: 223027
URL: http://svn.freebsd.org/changeset/base/223027
Log:
Add the dag->dag instruction selector class, needed to lower
LLVM instruction to IA64 instructions.
Added:
projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64DAGToDAGISel.cpp
Modified:
projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64.h
projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64TargetMachine.cpp
projects/llvm-ia64/lib/clang/libllvmia64codegen/Makefile
Modified: projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64.h
==============================================================================
--- projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64.h Sun Jun 12 23:33:08 2011 (r223026)
+++ projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64.h Sun Jun 12 23:45:46 2011 (r223027)
@@ -8,8 +8,8 @@ namespace llvm {
class FunctionPass;
class IA64TargetMachine;
- FunctionPass *createIA64ISelDag(IA64TargetMachine &TM,
- CodeGenOpt::Level OptLevel);
+ FunctionPass *createIA64ISelPass(IA64TargetMachine &TM,
+ CodeGenOpt::Level OptLevel);
FunctionPass *createIA64BundleSelectionPass();
Added: projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64DAGToDAGISel.cpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64DAGToDAGISel.cpp Sun Jun 12 23:45:46 2011 (r223027)
@@ -0,0 +1,75 @@
+#include "IA64.h"
+#include "IA64TargetMachine.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 "llvm/Support/ErrorHandling.h"
+#include "llvm/Support/raw_ostream.h"
+
+using namespace llvm;
+
+namespace {
+
+ class IA64DAGToDAGISel : public SelectionDAGISel {
+ const IA64TargetLowering &Lowering;
+ const IA64Subtarget &Subtarget;
+
+ public:
+ IA64DAGToDAGISel(IA64TargetMachine &TM, CodeGenOpt::Level OptLevel) :
+ SelectionDAGISel(TM, OptLevel),
+ Lowering(*TM.getTargetLowering()),
+ Subtarget(*TM.getSubtargetImpl()) { }
+
+ virtual const char *getPassName() const {
+ return "IA64 DAG->DAG Instruction Selection";
+ }
+
+// Include the pieces autogenerated from the target description.
+#include "IA64GenDAGISel.inc"
+
+ private:
+ SDNode *Select(SDNode *N);
+ };
+
+}
+
+FunctionPass *
+llvm::createIA64ISelPass(IA64TargetMachine &TM, CodeGenOpt::Level OptLevel)
+{
+ return new IA64DAGToDAGISel(TM, OptLevel);
+}
+
+
+SDNode *
+IA64DAGToDAGISel::Select(SDNode *Node)
+{
+ DebugLoc dl = Node->getDebugLoc();
+
+ // Dump information about the Node being selected
+ errs() << "Selecting: ";
+ Node->dump(CurDAG);
+ errs() << "\n";
+
+ SDNode *ResNode = SelectCode(Node);
+
+ errs() << "=> ";
+ if (ResNode == NULL || ResNode == Node)
+ Node->dump(CurDAG);
+ else
+ ResNode->dump(CurDAG);
+ errs() << "\n";
+
+ return ResNode;
+}
Modified: projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64TargetMachine.cpp
==============================================================================
--- projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64TargetMachine.cpp Sun Jun 12 23:33:08 2011 (r223026)
+++ projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64TargetMachine.cpp Sun Jun 12 23:45:46 2011 (r223027)
@@ -32,7 +32,7 @@ bool
IA64TargetMachine::addInstSelector(PassManagerBase &PM,
CodeGenOpt::Level OptLevel)
{
- // PM.add(createIA64ISelDag(*this, OptLevel));
+ PM.add(createIA64ISelPass(*this, OptLevel));
return false;
}
Modified: projects/llvm-ia64/lib/clang/libllvmia64codegen/Makefile
==============================================================================
--- projects/llvm-ia64/lib/clang/libllvmia64codegen/Makefile Sun Jun 12 23:33:08 2011 (r223026)
+++ projects/llvm-ia64/lib/clang/libllvmia64codegen/Makefile Sun Jun 12 23:45:46 2011 (r223027)
@@ -5,6 +5,7 @@ LIB= llvmia64codegen
SRCDIR= lib/Target/IA64
SRCS= \
IA64AsmPrinter.cpp \
+ IA64DAGToDAGISel.cpp \
IA64FrameLowering.cpp \
IA64InstrInfo.cpp \
IA64TargetLowering.cpp \
@@ -17,6 +18,7 @@ SRCS= \
TGHDRS= \
Intrinsics \
+ IA64GenDAGISel \
IA64GenInstrInfo \
IA64GenInstrNames \
IA64GenRegisterInfo \
More information about the svn-src-projects
mailing list