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"
|
|
|
|
#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"
|
2011-08-24 18:08:43 +00:00
|
|
|
#include "llvm/Support/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);
|
2006-09-07 23:39:26 +00:00
|
|
|
}
|
|
|
|
|
2011-07-19 06:37:02 +00:00
|
|
|
AlphaTargetMachine::AlphaTargetMachine(const Target &T, StringRef TT,
|
2011-07-20 07:51:56 +00:00
|
|
|
StringRef CPU, StringRef FS,
|
|
|
|
Reloc::Model RM, CodeModel::Model CM)
|
|
|
|
: LLVMTargetMachine(T, TT, CPU, FS, RM, CM),
|
2009-11-07 19:07:32 +00:00
|
|
|
DataLayout("e-f128:128:128-n64"),
|
2011-01-10 12:39:04 +00:00
|
|
|
FrameLowering(Subtarget),
|
2011-06-30 01:53:36 +00:00
|
|
|
Subtarget(TT, CPU, FS),
|
2010-05-11 17:31:57 +00:00
|
|
|
TLInfo(*this),
|
|
|
|
TSInfo(*this) {
|
2005-09-29 22:54:56 +00:00
|
|
|
}
|
2005-01-22 23:41:55 +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
|
|
|
}
|