2005-01-24 18:45:41 +00:00
|
|
|
//===-- AlphaTargetMachine.cpp - Define TargetMachine for Alpha -----------===//
|
2005-04-21 23:13:11 +00:00
|
|
|
//
|
2005-01-22 23:41:55 +00:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 20:36:04 +00:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2005-04-21 23:13:11 +00:00
|
|
|
//
|
2005-01-22 23:41:55 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
2005-04-21 23:13:11 +00:00
|
|
|
//
|
2005-01-22 23:41:55 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "Alpha.h"
|
2009-08-22 20:48:53 +00:00
|
|
|
#include "AlphaMCAsmInfo.h"
|
2005-01-22 23:41:55 +00:00
|
|
|
#include "AlphaTargetMachine.h"
|
2006-09-04 04:14:57 +00:00
|
|
|
#include "llvm/PassManager.h"
|
2009-07-14 20:18:05 +00:00
|
|
|
#include "llvm/Support/FormattedStream.h"
|
2009-07-25 06:49:55 +00:00
|
|
|
#include "llvm/Target/TargetRegistry.h"
|
2005-01-22 23:41:55 +00:00
|
|
|
using namespace llvm;
|
|
|
|
|
2009-07-25 06:49:55 +00:00
|
|
|
extern "C" void LLVMInitializeAlphaTarget() {
|
|
|
|
// Register the target.
|
|
|
|
RegisterTargetMachine<AlphaTargetMachine> X(TheAlphaTarget);
|
2009-08-22 20:48:53 +00:00
|
|
|
RegisterAsmInfo<AlphaMCAsmInfo> Y(TheAlphaTarget);
|
2006-09-07 23:39:26 +00:00
|
|
|
}
|
|
|
|
|
2009-08-02 23:37:13 +00:00
|
|
|
AlphaTargetMachine::AlphaTargetMachine(const Target &T, const std::string &TT,
|
2009-07-15 20:24:03 +00:00
|
|
|
const std::string &FS)
|
2009-08-11 20:42:37 +00:00
|
|
|
: LLVMTargetMachine(T, TT),
|
2009-11-07 19:07:32 +00:00
|
|
|
DataLayout("e-f128:128:128-n64"),
|
2011-01-10 12:39:04 +00:00
|
|
|
FrameLowering(Subtarget),
|
2009-08-02 23:37:13 +00:00
|
|
|
Subtarget(TT, FS),
|
2010-05-11 17:31:57 +00:00
|
|
|
TLInfo(*this),
|
|
|
|
TSInfo(*this) {
|
2006-09-24 19:46:56 +00:00
|
|
|
setRelocationModel(Reloc::PIC_);
|
2005-09-29 22:54:56 +00:00
|
|
|
}
|
2005-01-22 23:41:55 +00:00
|
|
|
|
2005-04-21 23:13:11 +00:00
|
|
|
|
2006-09-04 04:14:57 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Pass Pipeline Configuration
|
|
|
|
//===----------------------------------------------------------------------===//
|
2005-01-22 23:41:55 +00:00
|
|
|
|
2009-04-29 00:15:41 +00:00
|
|
|
bool AlphaTargetMachine::addInstSelector(PassManagerBase &PM,
|
2009-04-29 23:29:43 +00:00
|
|
|
CodeGenOpt::Level OptLevel) {
|
2006-01-23 21:56:07 +00:00
|
|
|
PM.add(createAlphaISelDag(*this));
|
2005-01-22 23:41:55 +00:00
|
|
|
return false;
|
|
|
|
}
|
2009-04-29 00:15:41 +00:00
|
|
|
bool AlphaTargetMachine::addPreEmitPass(PassManagerBase &PM,
|
2009-04-29 23:29:43 +00:00
|
|
|
CodeGenOpt::Level OptLevel) {
|
2005-07-22 20:52:16 +00:00
|
|
|
// Must run branch selection immediately preceding the asm printer
|
2006-10-31 16:49:55 +00:00
|
|
|
PM.add(createAlphaBranchSelectionPass());
|
2009-07-15 21:40:24 +00:00
|
|
|
PM.add(createAlphaLLRPPass(*this));
|
2006-09-04 04:14:57 +00:00
|
|
|
return false;
|
2005-07-22 20:52:16 +00:00
|
|
|
}
|