blob: eab34c2afaed395ee6c83d41e707b24dab3ded4d [file] [log] [blame]
Misha Brukmanbc9ccf62005-02-04 20:25:52 +00001//===-- AlphaTargetMachine.h - Define TargetMachine for Alpha ---*- C++ -*-===//
Misha Brukman4633f1c2005-04-21 23:13:11 +00002//
Andrew Lenharth304d0f32005-01-22 23:41:55 +00003// The LLVM Compiler Infrastructure
4//
Chris Lattner4ee451d2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Misha Brukman4633f1c2005-04-21 23:13:11 +00007//
Andrew Lenharth304d0f32005-01-22 23:41:55 +00008//===----------------------------------------------------------------------===//
Misha Brukman4633f1c2005-04-21 23:13:11 +00009//
Andrew Lenharth304d0f32005-01-22 23:41:55 +000010// This file declares the Alpha-specific subclass of TargetMachine.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef ALPHA_TARGETMACHINE_H
15#define ALPHA_TARGETMACHINE_H
16
17#include "llvm/Target/TargetMachine.h"
Owen Anderson07000c62006-05-12 06:33:49 +000018#include "llvm/Target/TargetData.h"
Andrew Lenharth304d0f32005-01-22 23:41:55 +000019#include "llvm/Target/TargetFrameInfo.h"
Andrew Lenharth304d0f32005-01-22 23:41:55 +000020#include "AlphaInstrInfo.h"
Andrew Lenharth0934ae02005-07-22 20:52:16 +000021#include "AlphaJITInfo.h"
Andrew Lenharth82c3d8f2006-10-11 04:29:42 +000022#include "AlphaISelLowering.h"
Andrew Lenharth120ab482005-09-29 22:54:56 +000023#include "AlphaSubtarget.h"
Andrew Lenharth304d0f32005-01-22 23:41:55 +000024
25namespace llvm {
26
27class GlobalValue;
Andrew Lenharth304d0f32005-01-22 23:41:55 +000028
Chris Lattner1911fd42006-09-04 04:14:57 +000029class AlphaTargetMachine : public LLVMTargetMachine {
Owen Andersona69571c2006-05-03 01:29:57 +000030 const TargetData DataLayout; // Calculates type size & alignment
Andrew Lenharth304d0f32005-01-22 23:41:55 +000031 AlphaInstrInfo InstrInfo;
32 TargetFrameInfo FrameInfo;
Andrew Lenharth0934ae02005-07-22 20:52:16 +000033 AlphaJITInfo JITInfo;
Andrew Lenharth120ab482005-09-29 22:54:56 +000034 AlphaSubtarget Subtarget;
Andrew Lenharth82c3d8f2006-10-11 04:29:42 +000035 AlphaTargetLowering TLInfo;
Jim Laskeyfde1b3b2006-09-07 23:39:26 +000036
37protected:
38 virtual const TargetAsmInfo *createTargetAsmInfo() const;
Owen Andersona69571c2006-05-03 01:29:57 +000039
Andrew Lenharth304d0f32005-01-22 23:41:55 +000040public:
Chris Lattnerbc641b92006-03-23 05:43:16 +000041 AlphaTargetMachine(const Module &M, const std::string &FS);
Misha Brukman4633f1c2005-04-21 23:13:11 +000042
43 virtual const AlphaInstrInfo *getInstrInfo() const { return &InstrInfo; }
Andrew Lenharth304d0f32005-01-22 23:41:55 +000044 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
Dan Gohmanc9f5f3f2008-05-14 01:58:56 +000045 virtual const AlphaSubtarget *getSubtargetImpl() const{ return &Subtarget; }
46 virtual const AlphaRegisterInfo *getRegisterInfo() const {
Andrew Lenharth304d0f32005-01-22 23:41:55 +000047 return &InstrInfo.getRegisterInfo();
48 }
Dan Gohmanc9f5f3f2008-05-14 01:58:56 +000049 virtual AlphaTargetLowering* getTargetLowering() const {
Andrew Lenharth82c3d8f2006-10-11 04:29:42 +000050 return const_cast<AlphaTargetLowering*>(&TLInfo);
51 }
Owen Andersona69571c2006-05-03 01:29:57 +000052 virtual const TargetData *getTargetData() const { return &DataLayout; }
Dan Gohmanc9f5f3f2008-05-14 01:58:56 +000053 virtual AlphaJITInfo* getJITInfo() {
Andrew Lenharth0934ae02005-07-22 20:52:16 +000054 return &JITInfo;
55 }
56
57 static unsigned getJITMatchQuality();
Andrew Lenharth2f401632005-02-01 20:35:11 +000058 static unsigned getModuleMatchQuality(const Module &M);
Chris Lattner1911fd42006-09-04 04:14:57 +000059
60 // Pass Pipeline Configuration
Dan Gohmanbfae8312008-03-11 22:29:46 +000061 virtual bool addInstSelector(PassManagerBase &PM, bool Fast);
62 virtual bool addPreEmitPass(PassManagerBase &PM, bool Fast);
63 virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast,
Chris Lattner1911fd42006-09-04 04:14:57 +000064 std::ostream &Out);
Dan Gohmanbfae8312008-03-11 22:29:46 +000065 virtual bool addCodeEmitter(PassManagerBase &PM, bool Fast,
Evan Cheng8bd60352007-07-20 21:56:13 +000066 bool DumpAsm, MachineCodeEmitter &MCE);
Dan Gohmanbfae8312008-03-11 22:29:46 +000067 virtual bool addSimpleCodeEmitter(PassManagerBase &PM, bool Fast,
Evan Cheng8bd60352007-07-20 21:56:13 +000068 bool DumpAsm, MachineCodeEmitter &MCE);
Andrew Lenharth304d0f32005-01-22 23:41:55 +000069};
70
71} // end namespace llvm
72
73#endif