2005-02-04 20:25:52 +00:00
|
|
|
//===-- AlphaTargetMachine.h - Define TargetMachine for Alpha ---*- C++ -*-===//
|
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
|
|
|
// This file declares the Alpha-specific subclass of TargetMachine.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef ALPHA_TARGETMACHINE_H
|
|
|
|
#define ALPHA_TARGETMACHINE_H
|
|
|
|
|
|
|
|
#include "llvm/Target/TargetMachine.h"
|
2006-05-12 06:33:49 +00:00
|
|
|
#include "llvm/Target/TargetData.h"
|
2005-01-22 23:41:55 +00:00
|
|
|
#include "llvm/Target/TargetFrameInfo.h"
|
|
|
|
#include "AlphaInstrInfo.h"
|
2005-07-22 20:52:16 +00:00
|
|
|
#include "AlphaJITInfo.h"
|
2006-10-11 04:29:42 +00:00
|
|
|
#include "AlphaISelLowering.h"
|
2005-09-29 22:54:56 +00:00
|
|
|
#include "AlphaSubtarget.h"
|
2005-01-22 23:41:55 +00:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
class GlobalValue;
|
|
|
|
|
2006-09-04 04:14:57 +00:00
|
|
|
class AlphaTargetMachine : public LLVMTargetMachine {
|
2006-05-03 01:29:57 +00:00
|
|
|
const TargetData DataLayout; // Calculates type size & alignment
|
2005-01-22 23:41:55 +00:00
|
|
|
AlphaInstrInfo InstrInfo;
|
|
|
|
TargetFrameInfo FrameInfo;
|
2005-07-22 20:52:16 +00:00
|
|
|
AlphaJITInfo JITInfo;
|
2005-09-29 22:54:56 +00:00
|
|
|
AlphaSubtarget Subtarget;
|
2006-10-11 04:29:42 +00:00
|
|
|
AlphaTargetLowering TLInfo;
|
2009-06-19 19:36:55 +00:00
|
|
|
|
2006-09-07 23:39:26 +00:00
|
|
|
protected:
|
|
|
|
virtual const TargetAsmInfo *createTargetAsmInfo() const;
|
2009-06-19 19:36:55 +00:00
|
|
|
|
|
|
|
// To avoid having target depend on the asmprinter stuff libraries, asmprinter
|
|
|
|
// set this functions to ctor pointer at startup time if they are linked in.
|
|
|
|
typedef FunctionPass *(*AsmPrinterCtorFn)(raw_ostream &o,
|
|
|
|
TargetMachine &tm,
|
|
|
|
bool verbose);
|
|
|
|
static AsmPrinterCtorFn AsmPrinterCtor;
|
|
|
|
|
2005-01-22 23:41:55 +00:00
|
|
|
public:
|
2006-03-23 05:43:16 +00:00
|
|
|
AlphaTargetMachine(const Module &M, const std::string &FS);
|
2005-04-21 23:13:11 +00:00
|
|
|
|
|
|
|
virtual const AlphaInstrInfo *getInstrInfo() const { return &InstrInfo; }
|
2005-01-22 23:41:55 +00:00
|
|
|
virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
|
2008-05-14 01:58:56 +00:00
|
|
|
virtual const AlphaSubtarget *getSubtargetImpl() const{ return &Subtarget; }
|
|
|
|
virtual const AlphaRegisterInfo *getRegisterInfo() const {
|
2005-01-22 23:41:55 +00:00
|
|
|
return &InstrInfo.getRegisterInfo();
|
|
|
|
}
|
2009-06-19 19:36:55 +00:00
|
|
|
virtual AlphaTargetLowering* getTargetLowering() const {
|
2006-10-11 04:29:42 +00:00
|
|
|
return const_cast<AlphaTargetLowering*>(&TLInfo);
|
|
|
|
}
|
2006-05-03 01:29:57 +00:00
|
|
|
virtual const TargetData *getTargetData() const { return &DataLayout; }
|
2008-05-14 01:58:56 +00:00
|
|
|
virtual AlphaJITInfo* getJITInfo() {
|
2005-07-22 20:52:16 +00:00
|
|
|
return &JITInfo;
|
|
|
|
}
|
|
|
|
|
|
|
|
static unsigned getJITMatchQuality();
|
2005-02-01 20:35:11 +00:00
|
|
|
static unsigned getModuleMatchQuality(const Module &M);
|
2009-06-19 19:36:55 +00:00
|
|
|
|
2006-09-04 04:14:57 +00:00
|
|
|
// Pass Pipeline Configuration
|
2009-04-29 23:29:43 +00:00
|
|
|
virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
|
|
|
|
virtual bool addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
|
|
|
|
virtual bool addAssemblyEmitter(PassManagerBase &PM,
|
|
|
|
CodeGenOpt::Level OptLevel,
|
2009-03-25 01:47:28 +00:00
|
|
|
bool Verbose, raw_ostream &Out);
|
2009-04-29 23:29:43 +00:00
|
|
|
virtual bool addCodeEmitter(PassManagerBase &PM, CodeGenOpt::Level OptLevel,
|
2007-07-20 21:56:13 +00:00
|
|
|
bool DumpAsm, MachineCodeEmitter &MCE);
|
2009-05-30 20:51:52 +00:00
|
|
|
virtual bool addCodeEmitter(PassManagerBase &PM, CodeGenOpt::Level OptLevel,
|
|
|
|
bool DumpAsm, JITCodeEmitter &JCE);
|
2009-07-06 05:09:34 +00:00
|
|
|
virtual bool addCodeEmitter(PassManagerBase &PM, CodeGenOpt::Level OptLevel,
|
|
|
|
bool DumpAsm, ObjectCodeEmitter &JCE);
|
2009-04-29 23:29:43 +00:00
|
|
|
virtual bool addSimpleCodeEmitter(PassManagerBase &PM,
|
|
|
|
CodeGenOpt::Level OptLevel,
|
|
|
|
bool DumpAsm,
|
|
|
|
MachineCodeEmitter &MCE);
|
2009-05-30 20:51:52 +00:00
|
|
|
virtual bool addSimpleCodeEmitter(PassManagerBase &PM,
|
|
|
|
CodeGenOpt::Level OptLevel,
|
|
|
|
bool DumpAsm,
|
|
|
|
JITCodeEmitter &JCE);
|
2009-07-06 05:09:34 +00:00
|
|
|
virtual bool addSimpleCodeEmitter(PassManagerBase &PM,
|
|
|
|
CodeGenOpt::Level OptLevel,
|
|
|
|
bool DumpAsm,
|
|
|
|
ObjectCodeEmitter &OCE);
|
2009-06-19 19:36:55 +00:00
|
|
|
|
|
|
|
static void registerAsmPrinter(AsmPrinterCtorFn F) {
|
|
|
|
AsmPrinterCtor = F;
|
|
|
|
}
|
2005-01-22 23:41:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|