svn commit: r222902 - in projects/llvm-ia64:
contrib/llvm/include/llvm/ADT contrib/llvm/lib/Support
contrib/llvm/lib/Target/IA64
contrib/llvm/lib/Target/IA64/TargetInfo lib/clang
lib/clang/include/...
Marcel Moolenaar
marcel at FreeBSD.org
Thu Jun 9 22:17:27 UTC 2011
Author: marcel
Date: Thu Jun 9 22:17:27 2011
New Revision: 222902
URL: http://svn.freebsd.org/changeset/base/222902
Log:
Add a skeletal IA64 backend.
Added:
projects/llvm-ia64/contrib/llvm/lib/Target/IA64/
projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64.h
projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64.td
projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64AsmPrinter.cpp
projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64FrameLowering.cpp
projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64FrameLowering.h
projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64InstrInfo.cpp
projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64InstrInfo.h
projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64MCAsmInfo.cpp
projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64MCAsmInfo.h
projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64RegisterInfo.cpp
projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64RegisterInfo.h
projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64SelectionDAGInfo.cpp
projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64SelectionDAGInfo.h
projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64Subtarget.cpp
projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64Subtarget.h
projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64TargetLowering.cpp
projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64TargetLowering.h
projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64TargetMachine.cpp
projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64TargetMachine.h
projects/llvm-ia64/contrib/llvm/lib/Target/IA64/TargetInfo/
projects/llvm-ia64/contrib/llvm/lib/Target/IA64/TargetInfo/IA64TargetInfo.cpp
projects/llvm-ia64/lib/clang/libllvmia64codegen/
projects/llvm-ia64/lib/clang/libllvmia64codegen/Makefile
projects/llvm-ia64/lib/clang/libllvmia64info/
projects/llvm-ia64/lib/clang/libllvmia64info/Makefile
Modified:
projects/llvm-ia64/contrib/llvm/include/llvm/ADT/Triple.h
projects/llvm-ia64/contrib/llvm/lib/Support/Triple.cpp
projects/llvm-ia64/lib/clang/Makefile
projects/llvm-ia64/lib/clang/clang.build.mk
projects/llvm-ia64/lib/clang/include/llvm/Config/Targets.def
projects/llvm-ia64/usr.bin/clang/clang/Makefile
Modified: projects/llvm-ia64/contrib/llvm/include/llvm/ADT/Triple.h
==============================================================================
--- projects/llvm-ia64/contrib/llvm/include/llvm/ADT/Triple.h Thu Jun 9 21:29:15 2011 (r222901)
+++ projects/llvm-ia64/contrib/llvm/include/llvm/ADT/Triple.h Thu Jun 9 22:17:27 2011 (r222902)
@@ -50,6 +50,7 @@ public:
arm, // ARM; arm, armv.*, xscale
bfin, // Blackfin: bfin
cellspu, // CellSPU: spu, cellspu
+ ia64, // IA-64: ia64
mips, // MIPS: mips, mipsallegrex
mipsel, // MIPSEL: mipsel, mipsallegrexel, psp
msp430, // MSP430: msp430
Modified: projects/llvm-ia64/contrib/llvm/lib/Support/Triple.cpp
==============================================================================
--- projects/llvm-ia64/contrib/llvm/lib/Support/Triple.cpp Thu Jun 9 21:29:15 2011 (r222901)
+++ projects/llvm-ia64/contrib/llvm/lib/Support/Triple.cpp Thu Jun 9 22:17:27 2011 (r222902)
@@ -27,6 +27,7 @@ const char *Triple::getArchTypeName(Arch
case arm: return "arm";
case bfin: return "bfin";
case cellspu: return "cellspu";
+ case ia64: return "ia64";
case mips: return "mips";
case mipsel: return "mipsel";
case msp430: return "msp430";
@@ -62,6 +63,8 @@ const char *Triple::getArchTypePrefix(Ar
case cellspu: return "spu";
+ case ia64: return "ia64";
+
case ppc64:
case ppc: return "ppc";
@@ -139,6 +142,8 @@ Triple::ArchType Triple::getArchTypeForL
return bfin;
if (Name == "cellspu")
return cellspu;
+ if (Name == "ia64")
+ return ia64;
if (Name == "mips")
return mips;
if (Name == "mipsel")
@@ -279,6 +284,8 @@ Triple::ArchType Triple::ParseArch(Strin
return alpha;
else if (ArchName == "spu" || ArchName == "cellspu")
return cellspu;
+ else if (ArchName == "ia64")
+ return ia64;
else if (ArchName == "msp430")
return msp430;
else if (ArchName == "mips" || ArchName == "mipsallegrex")
Added: projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64.h
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64.h Thu Jun 9 22:17:27 2011 (r222902)
@@ -0,0 +1,23 @@
+#ifndef LLVM_TARGET_IA64_H
+#define LLVM_TARGET_IA64_H
+
+#include "llvm/Target/TargetMachine.h"
+
+namespace llvm {
+
+ class FunctionPass;
+ class IA64TargetMachine;
+
+ FunctionPass *createIA64ISelDag(IA64TargetMachine &TM,
+ CodeGenOpt::Level OptLevel);
+
+ FunctionPass *createIA64BundleSelectionPass();
+
+ extern Target TheIA64Target;
+
+} // namespace llvm
+
+#include "IA64GenRegisterNames.inc"
+#include "IA64GenInstrNames.inc"
+
+#endif // LLVM_TARGET_IA64_H
Added: projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64.td
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64.td Thu Jun 9 22:17:27 2011 (r222902)
@@ -0,0 +1,55 @@
+include "llvm/Target/Target.td"
+
+//
+// Subtargets
+//
+class IA64Impl<string name, list<SubtargetFeature> features> :
+ Processor<name, NoItineraries, features>;
+
+def : IA64Impl<"merced", []>;
+def : IA64Impl<"mckinley", []>;
+
+//
+// Registers
+//
+class IA64Register<string name> : Register<name> {
+ let Namespace = "IA64";
+}
+
+def F0 : IA64Register<"f0">;
+def F1 : IA64Register<"f1">;
+
+def P0 : IA64Register<"p0">;
+
+def R0 : IA64Register<"r0">;
+
+//
+// Register classes
+//
+class IA64RegisterClass<list<ValueType> types, int align, list<Register> regs>
+ : RegisterClass<"IA64", types, align, regs> {
+}
+
+def FloatingPoint : IA64RegisterClass<[f128], 128, [F0, F1]>;
+def General : IA64RegisterClass<[i64], 64, [R0]>;
+def Predicate : IA64RegisterClass<[i1], 0, [P0]>;
+
+//
+// Instructions
+//
+class IA64Instruction<dag outs, dag ins> : Instruction {
+ let Namespace = "IA64";
+ let OutOperandList = outs;
+ let InOperandList = ins;
+}
+
+def NOP : IA64Instruction<(outs), (ins)>;
+
+def IA64InstrInfo : InstrInfo;
+
+//
+// Target for the Itanium Processor Family (IPF)
+//
+def IA64 : Target {
+ let InstructionSet = IA64InstrInfo;
+}
Added: projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64AsmPrinter.cpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64AsmPrinter.cpp Thu Jun 9 22:17:27 2011 (r222902)
@@ -0,0 +1,56 @@
+#include "IA64.h"
+
+#include "llvm/Module.h"
+#include "llvm/Type.h"
+#include "llvm/CodeGen/AsmPrinter.h"
+#include "llvm/CodeGen/DwarfWriter.h"
+#include "llvm/CodeGen/MachineFunctionPass.h"
+#include "llvm/MC/MCAsmInfo.h"
+#include "llvm/Target/TargetRegistry.h"
+#include "llvm/Support/ErrorHandling.h"
+#include "llvm/Support/FormattedStream.h"
+#include "llvm/ADT/Statistic.h"
+
+using namespace llvm;
+
+namespace {
+ class IA64AsmPrinter : public AsmPrinter {
+ std::set<std::string> ExternalFunctionNames, ExternalObjectNames;
+ public:
+ explicit IA64AsmPrinter(formatted_raw_ostream &O, TargetMachine &TM,
+ const MCAsmInfo *T, bool V) :
+ AsmPrinter(O, TM, T, V) {}
+
+ virtual const char *getPassName() const {
+ return "IA64 Assembly Printer";
+ }
+
+ static const char *getRegisterName(unsigned RegNo);
+
+ void PrintGlobalVariable(const GlobalVariable *GVar);
+
+ void printInstruction(const MachineInstr *MI);
+ bool runOnMachineFunction(MachineFunction &F);
+ };
+} // end of anonymous namespace
+
+#include "IA64GenAsmWriter.inc"
+
+void
+IA64AsmPrinter::PrintGlobalVariable(const GlobalVariable *GVar)
+{
+ llvm_unreachable(__func__);
+}
+
+bool
+IA64AsmPrinter::runOnMachineFunction(MachineFunction &MF)
+{
+ llvm_unreachable(__func__);
+}
+
+
+extern "C" void
+LLVMInitializeIA64AsmPrinter()
+{
+ RegisterAsmPrinter<IA64AsmPrinter> X(TheIA64Target);
+}
Added: projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64FrameLowering.cpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64FrameLowering.cpp Thu Jun 9 22:17:27 2011 (r222902)
@@ -0,0 +1,33 @@
+#include "IA64FrameLowering.h"
+#include "IA64InstrInfo.h"
+
+#include "llvm/Function.h"
+#include "llvm/CodeGen/MachineFrameInfo.h"
+#include "llvm/CodeGen/MachineFunction.h"
+#include "llvm/CodeGen/MachineInstrBuilder.h"
+#include "llvm/CodeGen/MachineModuleInfo.h"
+#include "llvm/CodeGen/MachineRegisterInfo.h"
+#include "llvm/Target/TargetData.h"
+#include "llvm/Target/TargetOptions.h"
+#include "llvm/Support/CommandLine.h"
+
+using namespace llvm;
+
+void
+IA64FrameLowering::emitPrologue(MachineFunction &MF) const
+{
+ llvm_unreachable(__func__);
+}
+
+void
+IA64FrameLowering::emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB)
+ const
+{
+ llvm_unreachable(__func__);
+}
+
+bool
+IA64FrameLowering::hasFP(const MachineFunction &MF) const
+{
+ llvm_unreachable(__func__);
+}
Added: projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64FrameLowering.h
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64FrameLowering.h Thu Jun 9 22:17:27 2011 (r222902)
@@ -0,0 +1,31 @@
+#ifndef LLVM_TARGET_IA64_FRAMELOWERING_H
+#define LLVM_TARGET_IA64_FRAMELOWERING_H
+
+#include "IA64.h"
+#include "IA64Subtarget.h"
+#include "llvm/Target/TargetFrameLowering.h"
+
+namespace llvm {
+
+ class IA64Subtarget;
+
+ class IA64FrameLowering : public TargetFrameLowering {
+ protected:
+ const IA64Subtarget &STI;
+
+ public:
+ explicit IA64FrameLowering(const IA64Subtarget &sti) :
+ TargetFrameLowering(TargetFrameLowering::StackGrowsDown, 2, -2),
+ STI(sti)
+ {
+ }
+
+ void emitPrologue(MachineFunction &MF) const;
+ void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
+
+ bool hasFP(const MachineFunction &MF) const;
+ };
+
+} // namespace llvm
+
+#endif // LLVM_TARGET_IA64_FRAMELOWERING_H
Added: projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64InstrInfo.cpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64InstrInfo.cpp Thu Jun 9 22:17:27 2011 (r222902)
@@ -0,0 +1,22 @@
+#include "IA64.h"
+#include "IA64InstrInfo.h"
+#include "IA64TargetMachine.h"
+
+#include "llvm/Function.h"
+#include "llvm/CodeGen/MachineFrameInfo.h"
+#include "llvm/CodeGen/MachineInstrBuilder.h"
+#include "llvm/CodeGen/MachineRegisterInfo.h"
+#include "llvm/CodeGen/PseudoSourceValue.h"
+#include "llvm/Support/ErrorHandling.h"
+
+#include "IA64GenInstrInfo.inc"
+
+using namespace llvm;
+
+IA64InstrInfo::IA64InstrInfo(IA64TargetMachine &tm) :
+ TargetInstrInfoImpl(IA64Insts, array_lengthof(IA64Insts)),
+ RI(tm, *this),
+ TM(tm)
+{
+ // nothing to do
+}
Added: projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64InstrInfo.h
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64InstrInfo.h Thu Jun 9 22:17:27 2011 (r222902)
@@ -0,0 +1,29 @@
+#ifndef LLVM_TARGET_IA64_INSTRINFO_H
+#define LLVM_TARGET_IA64_INSTRINFO_H
+
+#include "IA64RegisterInfo.h"
+
+#include "llvm/Target/TargetInstrInfo.h"
+
+namespace llvm {
+
+ class IA64TargetMachine;
+
+ class IA64InstrInfo : public TargetInstrInfoImpl {
+ const IA64RegisterInfo RI;
+ IA64TargetMachine &TM;
+
+ public:
+ explicit IA64InstrInfo(IA64TargetMachine &TM);
+
+ /// getRegisterInfo - TargetInstrInfo is a superset of MRegister info. As
+ /// such, whenever a client has an instance of instruction info, it should
+ /// always be able to get register info as well (through this method).
+ ///
+ virtual const TargetRegisterInfo &getRegisterInfo() const { return RI; }
+
+ };
+
+} // namespace llvm
+
+#endif // LLVM_TARGET_IA64_INSTRINFO_H
Added: projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64MCAsmInfo.cpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64MCAsmInfo.cpp Thu Jun 9 22:17:27 2011 (r222902)
@@ -0,0 +1,14 @@
+#include "IA64MCAsmInfo.h"
+
+using namespace llvm;
+
+IA64MCAsmInfo::IA64MCAsmInfo(const Target &T, StringRef TT) {
+ AsciiDirective = "\tstring\t";
+ AscizDirective = "\tstringz\t";
+ CommentString = "//";
+ Data8bitsDirective = "\tdata1\t";
+ Data16bitsDirective = "\tdata2\t";
+ Data32bitsDirective = "\tdata4\t";
+ Data64bitsDirective = "\tdata8\t";
+ ZeroDirective = NULL;
+}
Added: projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64MCAsmInfo.h
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64MCAsmInfo.h Thu Jun 9 22:17:27 2011 (r222902)
@@ -0,0 +1,16 @@
+#ifndef LLVM_TARGET_IA64_MCASMINFO_H
+#define LLVM_TARGET_IA64_MCASMINFO_H
+
+#include "llvm/ADT/StringRef.h"
+#include "llvm/MC/MCAsmInfo.h"
+
+namespace llvm {
+ class Target;
+
+ struct IA64MCAsmInfo : public MCAsmInfo {
+ explicit IA64MCAsmInfo(const Target &T, StringRef TT);
+ };
+
+} // namespace llvm
+
+#endif // LLVM_TARGET_IA64_MCASMINFO_H
Added: projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64RegisterInfo.cpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64RegisterInfo.cpp Thu Jun 9 22:17:27 2011 (r222902)
@@ -0,0 +1,63 @@
+#include "IA64.h"
+#include "IA64RegisterInfo.h"
+#include "IA64TargetMachine.h"
+
+#include "llvm/Function.h"
+#include "llvm/CodeGen/MachineFrameInfo.h"
+#include "llvm/CodeGen/MachineFunction.h"
+#include "llvm/CodeGen/MachineInstrBuilder.h"
+#include "llvm/Target/TargetMachine.h"
+#include "llvm/Target/TargetOptions.h"
+#include "llvm/ADT/BitVector.h"
+#include "llvm/Support/ErrorHandling.h"
+
+using namespace llvm;
+
+// FIXME: Provide proper call frame setup / destroy opcodes.
+IA64RegisterInfo::IA64RegisterInfo(IA64TargetMachine &tm,
+ const TargetInstrInfo &tii) :
+ IA64GenRegisterInfo(IA64::NOP, IA64::NOP),
+ TM(tm),
+ TII(tii)
+{
+ StackAlign = TM.getFrameLowering()->getStackAlignment();
+}
+
+const unsigned *
+IA64RegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const
+{
+ llvm_unreachable(__func__);
+}
+
+BitVector
+IA64RegisterInfo::getReservedRegs(const MachineFunction &MF) const
+{
+ llvm_unreachable(__func__);
+}
+
+void
+IA64RegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator MI, int SPAdj,
+ RegScavenger *RS) const
+{
+ llvm_unreachable(__func__);
+}
+
+int
+IA64RegisterInfo::getDwarfRegNum(unsigned RegNum, bool isEH) const
+{
+ return IA64GenRegisterInfo::getDwarfRegNumFull(RegNum, 0);
+}
+
+unsigned
+IA64RegisterInfo::getFrameRegister(const MachineFunction &MF) const
+{
+ llvm_unreachable(__func__);
+}
+
+unsigned
+IA64RegisterInfo::getRARegister() const
+{
+ llvm_unreachable(__func__);
+}
+
+#include "IA64GenRegisterInfo.inc"
Added: projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64RegisterInfo.h
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64RegisterInfo.h Thu Jun 9 22:17:27 2011 (r222902)
@@ -0,0 +1,40 @@
+#ifndef LLVM_TARGET_IA64_REGISTERINFO_H
+#define LLVM_TARGET_IA64_REGISTERINFO_H
+
+#include "llvm/Target/TargetRegisterInfo.h"
+
+#include "IA64GenRegisterInfo.h.inc"
+
+namespace llvm {
+
+ class TargetInstrInfo;
+ class IA64TargetMachine;
+
+ struct IA64RegisterInfo : public IA64GenRegisterInfo {
+ private:
+ IA64TargetMachine &TM;
+ const TargetInstrInfo &TII;
+
+ /// StackAlign - Default stack alignment.
+ ///
+ unsigned StackAlign;
+
+ public:
+ IA64RegisterInfo(IA64TargetMachine &tm, const TargetInstrInfo &tii);
+
+ const unsigned *getCalleeSavedRegs(const MachineFunction *MF = 0) const;
+
+ BitVector getReservedRegs(const MachineFunction &MF) const;
+
+ void eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj,
+ RegScavenger *RS = NULL) const;
+
+ int getDwarfRegNum(unsigned RegNum, bool isEH) const;
+
+ unsigned getFrameRegister(const MachineFunction &MF) const;
+ unsigned getRARegister() const;
+ };
+
+} // namespace llvm
+
+#endif // LLVM_TARGET_IA64_REGISTERINFO_H
Added: projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64SelectionDAGInfo.cpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64SelectionDAGInfo.cpp Thu Jun 9 22:17:27 2011 (r222902)
@@ -0,0 +1,12 @@
+#include "IA64TargetMachine.h"
+
+using namespace llvm;
+
+IA64SelectionDAGInfo::IA64SelectionDAGInfo(const IA64TargetMachine &TM) :
+ TargetSelectionDAGInfo(TM)
+{
+}
+
+IA64SelectionDAGInfo::~IA64SelectionDAGInfo()
+{
+}
Added: projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64SelectionDAGInfo.h
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64SelectionDAGInfo.h Thu Jun 9 22:17:27 2011 (r222902)
@@ -0,0 +1,18 @@
+#ifndef LLVM_TARGET_IA64_SELECTIONDAGINFO_H
+#define LLVM_TARGET_IA64_SELECTIONDAGINFO_H
+
+#include "llvm/Target/TargetSelectionDAGInfo.h"
+
+namespace llvm {
+
+ class IA64TargetMachine;
+
+ class IA64SelectionDAGInfo : public TargetSelectionDAGInfo {
+ public:
+ explicit IA64SelectionDAGInfo(const IA64TargetMachine &TM);
+ ~IA64SelectionDAGInfo();
+};
+
+} // namespace llvm
+
+#endif // LLVM_TARGET_IA64_SELECTIONDAGINFO_H
Added: projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64Subtarget.cpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64Subtarget.cpp Thu Jun 9 22:17:27 2011 (r222902)
@@ -0,0 +1,13 @@
+#include "IA64.h"
+#include "IA64Subtarget.h"
+
+#include "IA64GenSubtarget.inc"
+
+using namespace llvm;
+
+IA64Subtarget::IA64Subtarget(const std::string &TT, const std::string &FS) {
+ std::string CPU = "generic";
+
+ // Parse features string.
+ ParseSubtargetFeatures(FS, CPU);
+}
Added: projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64Subtarget.h
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64Subtarget.h Thu Jun 9 22:17:27 2011 (r222902)
@@ -0,0 +1,26 @@
+#ifndef LLVM_TARGET_IA64_SUBTARGET_H
+#define LLVM_TARGET_IA64_SUBTARGET_H
+
+#include "llvm/Target/TargetSubtarget.h"
+
+#include <string>
+
+namespace llvm {
+
+ class IA64Subtarget : public TargetSubtarget {
+ bool ExtendedInsts;
+
+ public:
+ /// This constructor initializes the data members to match that
+ /// of the specified triple.
+ IA64Subtarget(const std::string &TT, const std::string &FS);
+
+ /// ParseSubtargetFeatures - Parses features string setting specified
+ /// subtarget options. Definition of function is auto generated by tblgen.
+ std::string ParseSubtargetFeatures(const std::string &FS,
+ const std::string &CPU);
+ };
+
+} // End llvm namespace
+
+#endif // LLVM_TARGET_IA64_SUBTARGET_H
Added: projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64TargetLowering.cpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64TargetLowering.cpp Thu Jun 9 22:17:27 2011 (r222902)
@@ -0,0 +1,53 @@
+#include "IA64.h"
+#include "IA64Subtarget.h"
+#include "IA64TargetLowering.h"
+#include "IA64TargetMachine.h"
+
+#include "llvm/DerivedTypes.h"
+#include "llvm/Function.h"
+#include "llvm/Intrinsics.h"
+#include "llvm/CallingConv.h"
+#include "llvm/GlobalVariable.h"
+#include "llvm/GlobalAlias.h"
+#include "llvm/CodeGen/CallingConvLower.h"
+#include "llvm/CodeGen/MachineFrameInfo.h"
+#include "llvm/CodeGen/MachineFunction.h"
+#include "llvm/CodeGen/MachineInstrBuilder.h"
+#include "llvm/CodeGen/MachineRegisterInfo.h"
+#include "llvm/CodeGen/PseudoSourceValue.h"
+#include "llvm/CodeGen/SelectionDAGISel.h"
+#include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
+#include "llvm/CodeGen/ValueTypes.h"
+#include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Debug.h"
+#include "llvm/Support/ErrorHandling.h"
+#include "llvm/Support/raw_ostream.h"
+#include "llvm/ADT/VectorExtras.h"
+
+using namespace llvm;
+
+IA64TargetLowering::IA64TargetLowering(IA64TargetMachine &tm) :
+ TargetLowering(tm, new TargetLoweringObjectFileELF()),
+ Subtarget(*tm.getSubtargetImpl()),
+ TM(tm)
+{
+ TD = getTargetData();
+
+ // Set up the register classes.
+ addRegisterClass(MVT::f128, &IA64::FloatingPointRegClass);
+ addRegisterClass(MVT::i64, &IA64::GeneralRegClass);
+ addRegisterClass(MVT::i1, &IA64::PredicateRegClass);
+
+ // Compute derived properties from the register classes
+ computeRegisterProperties();
+}
+
+unsigned
+IA64TargetLowering::getFunctionAlignment(const Function *F) const
+{
+ // Functions must have at least 16-byte alignment, but 32-byte alignment
+ // is better because branch targets should be aligned on 32-byte boundaries
+ // to ensure that the front-end can deliver 2 bundles per cycle to the
+ // back-end.
+ return F->hasFnAttr(Attribute::OptimizeForSize) ? 4 : 5;
+}
Added: projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64TargetLowering.h
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64TargetLowering.h Thu Jun 9 22:17:27 2011 (r222902)
@@ -0,0 +1,26 @@
+#ifndef LLVM_TARGET_IA64_TARGETLOWERING_H
+#define LLVM_TARGET_IA64_TARGETLOWERING_H
+
+#include "IA64.h"
+#include "llvm/CodeGen/SelectionDAG.h"
+#include "llvm/Target/TargetLowering.h"
+
+namespace llvm {
+
+ class IA64Subtarget;
+ class IA64TargetMachine;
+
+ class IA64TargetLowering : public TargetLowering {
+ const TargetData *TD;
+ const IA64Subtarget &Subtarget;
+ const IA64TargetMachine &TM;
+
+ public:
+ explicit IA64TargetLowering(IA64TargetMachine &TM);
+
+ virtual unsigned getFunctionAlignment(const Function *F) const;
+ };
+
+} // namespace llvm
+
+#endif // LLVM_TARGET_IA64_TARGETLOWERING_H
Added: projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64TargetMachine.cpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64TargetMachine.cpp Thu Jun 9 22:17:27 2011 (r222902)
@@ -0,0 +1,45 @@
+#include "IA64.h"
+#include "IA64MCAsmInfo.h"
+#include "IA64TargetMachine.h"
+
+#include "llvm/PassManager.h"
+#include "llvm/CodeGen/Passes.h"
+#include "llvm/MC/MCAsmInfo.h"
+#include "llvm/Target/TargetRegistry.h"
+
+using namespace llvm;
+
+extern "C" void
+LLVMInitializeIA64Target() {
+ RegisterTargetMachine<IA64TargetMachine> X(TheIA64Target);
+ RegisterAsmInfo<IA64MCAsmInfo> Z(TheIA64Target);
+}
+
+IA64TargetMachine::IA64TargetMachine(const Target &T, const std::string &TT,
+ const std::string &FS) :
+ LLVMTargetMachine(T, TT),
+ Subtarget(TT, FS),
+ DataLayout("e-i64:64:64-f80:128:128-f128:128:128-n8:16:32:64"),
+ InstrInfo(*this),
+ TLInfo(*this),
+ TSInfo(*this),
+ FrameLowering(Subtarget)
+{
+ // Nothing to do.
+}
+
+bool
+IA64TargetMachine::addInstSelector(PassManagerBase &PM,
+ CodeGenOpt::Level OptLevel)
+{
+ // PM.add(createIA64ISelDag(*this, OptLevel));
+ return false;
+}
+
+bool
+IA64TargetMachine::addPreEmitPass(PassManagerBase &PM,
+ CodeGenOpt::Level OptLevel)
+{
+ // PM.add(createIA64BundleSelectionPass());
+ return false;
+}
Added: projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64TargetMachine.h
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64TargetMachine.h Thu Jun 9 22:17:27 2011 (r222902)
@@ -0,0 +1,59 @@
+#ifndef LLVM_TARGET_IA64_TARGETMACHINE_H
+#define LLVM_TARGET_IA64_TARGETMACHINE_H
+
+#include "IA64FrameLowering.h"
+#include "IA64InstrInfo.h"
+#include "IA64SelectionDAGInfo.h"
+#include "IA64Subtarget.h"
+#include "IA64TargetLowering.h"
+
+#include "llvm/Target/TargetData.h"
+#include "llvm/Target/TargetFrameLowering.h"
+#include "llvm/Target/TargetMachine.h"
+
+namespace llvm {
+
+ class IA64TargetMachine : public LLVMTargetMachine {
+ IA64Subtarget Subtarget;
+ const TargetData DataLayout; // Calculates type size & alignment
+ IA64InstrInfo InstrInfo;
+ IA64TargetLowering TLInfo;
+ IA64SelectionDAGInfo TSInfo;
+ IA64FrameLowering FrameLowering;
+
+ public:
+ IA64TargetMachine(const Target &T, const std::string &TT,
+ const std::string &FS);
+
+ virtual const TargetFrameLowering *getFrameLowering() const {
+ return &FrameLowering;
+ }
+
+ virtual const IA64InstrInfo *getInstrInfo() const { return &InstrInfo; }
+ virtual const TargetData *getTargetData() const { return &DataLayout;}
+
+ virtual const IA64Subtarget *getSubtargetImpl() const {
+ return &Subtarget;
+ }
+
+ virtual const TargetRegisterInfo *getRegisterInfo() const {
+ return &InstrInfo.getRegisterInfo();
+ }
+
+ virtual const IA64TargetLowering *getTargetLowering() const {
+ return &TLInfo;
+ }
+
+ virtual const IA64SelectionDAGInfo* getSelectionDAGInfo() const {
+ return &TSInfo;
+ }
+
+ virtual bool addInstSelector(PassManagerBase &PM,
+ CodeGenOpt::Level OptLevel);
+ virtual bool addPreEmitPass(PassManagerBase &PM,
+ CodeGenOpt::Level OptLevel);
+ };
+
+} // namespace llvm
+
+#endif // LLVM_TARGET_IA64_TARGETMACHINE_H
Added: projects/llvm-ia64/contrib/llvm/lib/Target/IA64/TargetInfo/IA64TargetInfo.cpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/llvm-ia64/contrib/llvm/lib/Target/IA64/TargetInfo/IA64TargetInfo.cpp Thu Jun 9 22:17:27 2011 (r222902)
@@ -0,0 +1,14 @@
+#include "IA64.h"
+#include "llvm/Module.h"
+#include "llvm/Target/TargetRegistry.h"
+
+using namespace llvm;
+
+Target llvm::TheIA64Target;
+
+extern "C" void
+LLVMInitializeIA64TargetInfo()
+{
+ RegisterTarget<Triple::ia64, /*HasJIT=*/false>
+ X(TheIA64Target, "ia64", "Itanium Processor Family");
+}
Modified: projects/llvm-ia64/lib/clang/Makefile
==============================================================================
--- projects/llvm-ia64/lib/clang/Makefile Thu Jun 9 21:29:15 2011 (r222901)
+++ projects/llvm-ia64/lib/clang/Makefile Thu Jun 9 22:17:27 2011 (r222902)
@@ -42,6 +42,8 @@ SUBDIR= libclanganalysis \
libllvmarmdisassembler \
libllvmarminfo \
libllvmarminstprinter \
+ libllvmia64codegen \
+ libllvmia64info \
libllvmmipscodegen \
libllvmmipsinfo \
libllvmpowerpccodegen \
Modified: projects/llvm-ia64/lib/clang/clang.build.mk
==============================================================================
--- projects/llvm-ia64/lib/clang/clang.build.mk Thu Jun 9 21:29:15 2011 (r222901)
+++ projects/llvm-ia64/lib/clang/clang.build.mk Thu Jun 9 22:17:27 2011 (r222902)
@@ -40,7 +40,7 @@ Intrinsics.inc.h: ${LLVM_SRCS}/include/l
${TBLGEN} -gen-intrinsic \
${LLVM_SRCS}/include/llvm/Intrinsics.td > ${.TARGET}
.for arch in \
- ARM/ARM Mips/Mips PowerPC/PPC X86/X86
+ ARM/ARM IA64/IA64 Mips/Mips PowerPC/PPC X86/X86
. for hdr in \
AsmMatcher/-gen-asm-matcher \
AsmWriter1/-gen-asm-writer,-asmwriternum=1 \
Modified: projects/llvm-ia64/lib/clang/include/llvm/Config/Targets.def
==============================================================================
--- projects/llvm-ia64/lib/clang/include/llvm/Config/Targets.def Thu Jun 9 21:29:15 2011 (r222901)
+++ projects/llvm-ia64/lib/clang/include/llvm/Config/Targets.def Thu Jun 9 22:17:27 2011 (r222902)
@@ -1,6 +1,7 @@
/* $FreeBSD$ */
LLVM_TARGET(ARM)
+LLVM_TARGET(IA64)
LLVM_TARGET(Mips)
LLVM_TARGET(PowerPC)
LLVM_TARGET(X86)
Added: projects/llvm-ia64/lib/clang/libllvmia64codegen/Makefile
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/llvm-ia64/lib/clang/libllvmia64codegen/Makefile Thu Jun 9 22:17:27 2011 (r222902)
@@ -0,0 +1,25 @@
+# $FreeBSD$
+
+LIB= llvmia64codegen
+
+SRCDIR= lib/Target/IA64
+SRCS= \
+ IA64FrameLowering.cpp \
+ IA64InstrInfo.cpp \
+ IA64TargetLowering.cpp \
+ IA64MCAsmInfo.cpp \
+ IA64RegisterInfo.cpp \
+ IA64SelectionDAGInfo.cpp \
+ IA64Subtarget.cpp \
+ IA64TargetMachine.cpp
+
+TGHDRS= \
+ Intrinsics \
+ IA64GenInstrInfo \
+ IA64GenInstrNames \
+ IA64GenRegisterInfo \
+ IA64GenRegisterInfo.h \
+ IA64GenRegisterNames \
+ IA64GenSubtarget
+
+.include "../clang.lib.mk"
Added: projects/llvm-ia64/lib/clang/libllvmia64info/Makefile
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/llvm-ia64/lib/clang/libllvmia64info/Makefile Thu Jun 9 22:17:27 2011 (r222902)
@@ -0,0 +1,13 @@
+# $FreeBSD: head/lib/clang/libllvmx86info/Makefile 212847 2010-09-19 10:54:58Z dim $
+
+LIB= llvmia64info
+
+SRCDIR= lib/Target/IA64/TargetInfo/
+INCDIR= lib/Target/IA64
+SRCS= IA64TargetInfo.cpp
+
+TGHDRS= \
+ IA64GenInstrNames \
+ IA64GenRegisterNames
+
+.include "../clang.lib.mk"
Modified: projects/llvm-ia64/usr.bin/clang/clang/Makefile
==============================================================================
--- projects/llvm-ia64/usr.bin/clang/clang/Makefile Thu Jun 9 21:29:15 2011 (r222901)
+++ projects/llvm-ia64/usr.bin/clang/clang/Makefile Thu Jun 9 22:17:27 2011 (r222902)
@@ -45,6 +45,8 @@ LIBDEPS=clangfrontendtool \
llvmarmcodegen \
llvmarminstprinter \
llvmarminfo \
+ llvmia64codegen \
+ llvmia64info \
llvmmipscodegen \
llvmmipsinfo \
llvmpowerpccodegen \
More information about the svn-src-projects
mailing list