blob: 37e7cd2b7b3ad3f634b4df30513eaf18afeb25ee [file] [log] [blame]
Scott Michel564427e2007-12-05 01:24:05 +00001//===-- SPUTargetMachine.h - Define TargetMachine for Cell SPU ----*- C++ -*-=//
2//
3// 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.
Scott Michel564427e2007-12-05 01:24:05 +00007//
8//===----------------------------------------------------------------------===//
9//
10// This file declares the CellSPU-specific subclass of TargetMachine.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef SPU_TARGETMACHINE_H
15#define SPU_TARGETMACHINE_H
16
17#include "SPUSubtarget.h"
18#include "SPUInstrInfo.h"
19#include "SPUISelLowering.h"
20#include "SPUFrameInfo.h"
21#include "llvm/Target/TargetMachine.h"
22#include "llvm/Target/TargetData.h"
23
24namespace llvm {
25class PassManager;
26class GlobalValue;
27class TargetFrameInfo;
28
29/// SPUTargetMachine
30///
31class SPUTargetMachine : public LLVMTargetMachine {
32 SPUSubtarget Subtarget;
33 const TargetData DataLayout;
34 SPUInstrInfo InstrInfo;
35 SPUFrameInfo FrameInfo;
36 SPUTargetLowering TLInfo;
37 InstrItineraryData InstrItins;
Scott Michel564427e2007-12-05 01:24:05 +000038public:
Daniel Dunbare28039c2009-08-02 23:37:13 +000039 SPUTargetMachine(const Target &T, const std::string &TT,
40 const std::string &FS);
Scott Michel564427e2007-12-05 01:24:05 +000041
42 /// Return the subtarget implementation object
43 virtual const SPUSubtarget *getSubtargetImpl() const {
44 return &Subtarget;
45 }
46 virtual const SPUInstrInfo *getInstrInfo() const {
47 return &InstrInfo;
48 }
Dan Gohmanc9f5f3f2008-05-14 01:58:56 +000049 virtual const SPUFrameInfo *getFrameInfo() const {
Scott Michel564427e2007-12-05 01:24:05 +000050 return &FrameInfo;
51 }
52 /*!
53 \note Cell SPU does not support JIT today. It could support JIT at some
54 point.
55 */
56 virtual TargetJITInfo *getJITInfo() {
57 return NULL;
58 }
Scott Michel564427e2007-12-05 01:24:05 +000059
Dan Gohmand858e902010-04-17 15:26:15 +000060 virtual const SPUTargetLowering *getTargetLowering() const {
61 return &TLInfo;
Scott Michel564427e2007-12-05 01:24:05 +000062 }
63
Dan Gohmanc9f5f3f2008-05-14 01:58:56 +000064 virtual const SPURegisterInfo *getRegisterInfo() const {
Scott Michel564427e2007-12-05 01:24:05 +000065 return &InstrInfo.getRegisterInfo();
66 }
67
68 virtual const TargetData *getTargetData() const {
69 return &DataLayout;
70 }
71
Anton Korobeynikove494b9e2009-06-19 19:36:55 +000072 virtual const InstrItineraryData getInstrItineraryData() const {
Scott Michel564427e2007-12-05 01:24:05 +000073 return InstrItins;
74 }
75
76 // Pass Pipeline Configuration
Bill Wendling98a366d2009-04-29 23:29:43 +000077 virtual bool addInstSelector(PassManagerBase &PM,
78 CodeGenOpt::Level OptLevel);
Scott Michel564427e2007-12-05 01:24:05 +000079};
80
81} // end namespace llvm
82
83#endif