blob: 956794dddaf9217dfff658bb488134bab9dc378d [file] [log] [blame]
Jia Liu31d157a2012-02-18 12:03:15 +00001//===-- MBlazeTargetMachine.h - Define TargetMachine for MBlaze -*- C++ -*-===//
Wesley Pecka70f28c2010-02-23 19:15:24 +00002//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file declares the MBlaze specific subclass of TargetMachine.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef MBLAZE_TARGETMACHINE_H
15#define MBLAZE_TARGETMACHINE_H
16
Anton Korobeynikov16c29b52011-01-10 12:39:04 +000017#include "MBlazeFrameLowering.h"
Chandler Carrutha1514e22012-12-04 07:12:27 +000018#include "MBlazeISelLowering.h"
19#include "MBlazeInstrInfo.h"
20#include "MBlazeIntrinsicInfo.h"
21#include "MBlazeSelectionDAGInfo.h"
22#include "MBlazeSubtarget.h"
Chandler Carruth0b8c9a82013-01-02 11:36:10 +000023#include "llvm/IR/DataLayout.h"
Chandler Carrutha1514e22012-12-04 07:12:27 +000024#include "llvm/MC/MCStreamer.h"
Anton Korobeynikov16c29b52011-01-10 12:39:04 +000025#include "llvm/Target/TargetFrameLowering.h"
Chandler Carrutha1514e22012-12-04 07:12:27 +000026#include "llvm/Target/TargetMachine.h"
Wesley Pecka70f28c2010-02-23 19:15:24 +000027
28namespace llvm {
29 class formatted_raw_ostream;
30
31 class MBlazeTargetMachine : public LLVMTargetMachine {
Anton Korobeynikov16c29b52011-01-10 12:39:04 +000032 MBlazeSubtarget Subtarget;
Micah Villmow3574eca2012-10-08 16:38:25 +000033 const DataLayout DL; // Calculates type size & alignment
Anton Korobeynikov16c29b52011-01-10 12:39:04 +000034 MBlazeInstrInfo InstrInfo;
35 MBlazeFrameLowering FrameLowering;
36 MBlazeTargetLowering TLInfo;
Dan Gohmanff7a5622010-05-11 17:31:57 +000037 MBlazeSelectionDAGInfo TSInfo;
Anton Korobeynikov16c29b52011-01-10 12:39:04 +000038 MBlazeIntrinsicInfo IntrinsicInfo;
Wesley Peck3d820ba2011-04-11 22:31:52 +000039 InstrItineraryData InstrItins;
40
Wesley Pecka70f28c2010-02-23 19:15:24 +000041 public:
Evan Cheng43966132011-07-19 06:37:02 +000042 MBlazeTargetMachine(const Target &T, StringRef TT,
Evan Cheng34ad6db2011-07-20 07:51:56 +000043 StringRef CPU, StringRef FS,
Nick Lewycky8a8d4792011-12-02 22:16:29 +000044 const TargetOptions &Options,
Evan Chengb95fc312011-11-16 08:38:26 +000045 Reloc::Model RM, CodeModel::Model CM,
46 CodeGenOpt::Level OL);
Wesley Pecka70f28c2010-02-23 19:15:24 +000047
48 virtual const MBlazeInstrInfo *getInstrInfo() const
49 { return &InstrInfo; }
50
Wesley Peck3d820ba2011-04-11 22:31:52 +000051 virtual const InstrItineraryData *getInstrItineraryData() const
52 { return &InstrItins; }
53
Anton Korobeynikov16c29b52011-01-10 12:39:04 +000054 virtual const TargetFrameLowering *getFrameLowering() const
55 { return &FrameLowering; }
Wesley Pecka70f28c2010-02-23 19:15:24 +000056
57 virtual const MBlazeSubtarget *getSubtargetImpl() const
58 { return &Subtarget; }
59
Micah Villmow3574eca2012-10-08 16:38:25 +000060 virtual const DataLayout *getDataLayout() const
61 { return &DL;}
Wesley Pecka70f28c2010-02-23 19:15:24 +000062
63 virtual const MBlazeRegisterInfo *getRegisterInfo() const
64 { return &InstrInfo.getRegisterInfo(); }
65
Dan Gohmand858e902010-04-17 15:26:15 +000066 virtual const MBlazeTargetLowering *getTargetLowering() const
67 { return &TLInfo; }
Wesley Pecka70f28c2010-02-23 19:15:24 +000068
Dan Gohmanff7a5622010-05-11 17:31:57 +000069 virtual const MBlazeSelectionDAGInfo* getSelectionDAGInfo() const
70 { return &TSInfo; }
71
Wesley Pecka70f28c2010-02-23 19:15:24 +000072 const TargetIntrinsicInfo *getIntrinsicInfo() const
73 { return &IntrinsicInfo; }
74
Wesley Pecka70f28c2010-02-23 19:15:24 +000075 // Pass Pipeline Configuration
Andrew Trick061efcf2012-02-04 02:56:59 +000076 virtual TargetPassConfig *createPassConfig(PassManagerBase &PM);
Wesley Pecka70f28c2010-02-23 19:15:24 +000077 };
78} // End llvm namespace
79
80#endif