blob: 70aabde5f6777ffcb81c4521c9cc966c81b438e0 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001//===-- IA64TargetMachine.cpp - Define TargetMachine for IA64 -------------===//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner081ce942007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Dan Gohmanf17a25c2007-07-18 16:29:46 +00007//
8//===----------------------------------------------------------------------===//
9//
10// This file implements the IA64 specific subclass of TargetMachine.
11//
12//===----------------------------------------------------------------------===//
13
14#include "IA64TargetAsmInfo.h"
15#include "IA64TargetMachine.h"
16#include "IA64.h"
17#include "llvm/Module.h"
18#include "llvm/PassManager.h"
19#include "llvm/Target/TargetMachineRegistry.h"
20using namespace llvm;
21
Anton Korobeynikovbab832e2009-06-19 19:36:55 +000022// Register the target
Daniel Dunbarfe5939f2009-07-15 20:24:03 +000023extern Target TheIA64Target;
24static RegisterTarget<IA64TargetMachine> X(TheIA64Target, "ia64",
Chris Lattner3f83d3f2008-10-16 06:16:50 +000025 "IA-64 (Itanium) [experimental]");
Dan Gohmanf17a25c2007-07-18 16:29:46 +000026
Bob Wilsonebbc1c42009-06-23 23:59:40 +000027// Force static initialization.
28extern "C" void LLVMInitializeIA64Target() { }
Douglas Gregor1dc5ff42009-06-16 20:12:29 +000029
Dan Gohmanf17a25c2007-07-18 16:29:46 +000030const TargetAsmInfo *IA64TargetMachine::createTargetAsmInfo() const {
31 return new IA64TargetAsmInfo(*this);
32}
33
Dan Gohmanf17a25c2007-07-18 16:29:46 +000034/// IA64TargetMachine ctor - Create an LP64 architecture model
35///
Daniel Dunbarfe5939f2009-07-15 20:24:03 +000036IA64TargetMachine::IA64TargetMachine(const Target &T, const Module &M,
37 const std::string &FS)
38 : LLVMTargetMachine(T),
39 DataLayout("e-f80:128:128"),
Dan Gohmanf17a25c2007-07-18 16:29:46 +000040 FrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0),
41 TLInfo(*this) { // FIXME? check this stuff
42}
43
44
45//===----------------------------------------------------------------------===//
46// Pass Pipeline Configuration
47//===----------------------------------------------------------------------===//
48
Bill Wendling5ed22ac2009-04-29 23:29:43 +000049bool IA64TargetMachine::addInstSelector(PassManagerBase &PM,
Daniel Dunbarb10d2222009-07-01 01:48:54 +000050 CodeGenOpt::Level OptLevel) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000051 PM.add(createIA64DAGToDAGInstructionSelector(*this));
52 return false;
53}
54
Bill Wendling5ed22ac2009-04-29 23:29:43 +000055bool IA64TargetMachine::addPreEmitPass(PassManagerBase &PM,
56 CodeGenOpt::Level OptLevel) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000057 // Make sure everything is bundled happily
58 PM.add(createIA64BundlingPass(*this));
59 return true;
60}