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