2012-02-18 20:03:15 +08:00
|
|
|
//===-- MBlazeTargetMachine.h - Define TargetMachine for MBlaze -*- C++ -*-===//
|
2010-02-24 03:15:24 +08:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file declares the MBlaze specific subclass of TargetMachine.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef MBLAZE_TARGETMACHINE_H
|
|
|
|
#define MBLAZE_TARGETMACHINE_H
|
|
|
|
|
2012-12-04 15:12:27 +08:00
|
|
|
#include "MBlazeFrameLowering.h"
|
2010-02-24 03:15:24 +08:00
|
|
|
#include "MBlazeISelLowering.h"
|
2012-12-04 15:12:27 +08:00
|
|
|
#include "MBlazeInstrInfo.h"
|
2010-02-24 03:15:24 +08:00
|
|
|
#include "MBlazeIntrinsicInfo.h"
|
2012-12-04 15:12:27 +08:00
|
|
|
#include "MBlazeSelectionDAGInfo.h"
|
|
|
|
#include "MBlazeSubtarget.h"
|
2012-10-09 00:38:25 +08:00
|
|
|
#include "llvm/DataLayout.h"
|
2012-12-04 15:12:27 +08:00
|
|
|
#include "llvm/MC/MCStreamer.h"
|
2011-01-10 20:39:04 +08:00
|
|
|
#include "llvm/Target/TargetFrameLowering.h"
|
2012-12-04 15:12:27 +08:00
|
|
|
#include "llvm/Target/TargetMachine.h"
|
2012-10-19 07:22:48 +08:00
|
|
|
#include "llvm/Target/TargetTransformImpl.h"
|
2010-02-24 03:15:24 +08:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
class formatted_raw_ostream;
|
|
|
|
|
|
|
|
class MBlazeTargetMachine : public LLVMTargetMachine {
|
2011-01-10 20:39:04 +08:00
|
|
|
MBlazeSubtarget Subtarget;
|
2012-10-09 00:38:25 +08:00
|
|
|
const DataLayout DL; // Calculates type size & alignment
|
2011-01-10 20:39:04 +08:00
|
|
|
MBlazeInstrInfo InstrInfo;
|
|
|
|
MBlazeFrameLowering FrameLowering;
|
|
|
|
MBlazeTargetLowering TLInfo;
|
2010-05-12 01:31:57 +08:00
|
|
|
MBlazeSelectionDAGInfo TSInfo;
|
2011-01-10 20:39:04 +08:00
|
|
|
MBlazeIntrinsicInfo IntrinsicInfo;
|
2011-04-12 06:31:52 +08:00
|
|
|
InstrItineraryData InstrItins;
|
2012-10-19 07:22:48 +08:00
|
|
|
ScalarTargetTransformImpl STTI;
|
|
|
|
VectorTargetTransformImpl VTTI;
|
2011-04-12 06:31:52 +08:00
|
|
|
|
2010-02-24 03:15:24 +08:00
|
|
|
public:
|
2011-07-19 14:37:02 +08:00
|
|
|
MBlazeTargetMachine(const Target &T, StringRef TT,
|
2011-07-20 15:51:56 +08:00
|
|
|
StringRef CPU, StringRef FS,
|
2011-12-03 06:16:29 +08:00
|
|
|
const TargetOptions &Options,
|
2011-11-16 16:38:26 +08:00
|
|
|
Reloc::Model RM, CodeModel::Model CM,
|
|
|
|
CodeGenOpt::Level OL);
|
2010-02-24 03:15:24 +08:00
|
|
|
|
|
|
|
virtual const MBlazeInstrInfo *getInstrInfo() const
|
|
|
|
{ return &InstrInfo; }
|
|
|
|
|
2011-04-12 06:31:52 +08:00
|
|
|
virtual const InstrItineraryData *getInstrItineraryData() const
|
|
|
|
{ return &InstrItins; }
|
|
|
|
|
2011-01-10 20:39:04 +08:00
|
|
|
virtual const TargetFrameLowering *getFrameLowering() const
|
|
|
|
{ return &FrameLowering; }
|
2010-02-24 03:15:24 +08:00
|
|
|
|
|
|
|
virtual const MBlazeSubtarget *getSubtargetImpl() const
|
|
|
|
{ return &Subtarget; }
|
|
|
|
|
2012-10-09 00:38:25 +08:00
|
|
|
virtual const DataLayout *getDataLayout() const
|
|
|
|
{ return &DL;}
|
2010-02-24 03:15:24 +08:00
|
|
|
|
|
|
|
virtual const MBlazeRegisterInfo *getRegisterInfo() const
|
|
|
|
{ return &InstrInfo.getRegisterInfo(); }
|
|
|
|
|
2010-04-17 23:26:15 +08:00
|
|
|
virtual const MBlazeTargetLowering *getTargetLowering() const
|
|
|
|
{ return &TLInfo; }
|
2010-02-24 03:15:24 +08:00
|
|
|
|
2010-05-12 01:31:57 +08:00
|
|
|
virtual const MBlazeSelectionDAGInfo* getSelectionDAGInfo() const
|
|
|
|
{ return &TSInfo; }
|
|
|
|
|
2010-02-24 03:15:24 +08:00
|
|
|
const TargetIntrinsicInfo *getIntrinsicInfo() const
|
|
|
|
{ return &IntrinsicInfo; }
|
|
|
|
|
2012-10-19 07:22:48 +08:00
|
|
|
virtual const ScalarTargetTransformInfo *getScalarTargetTransformInfo()const
|
|
|
|
{ return &STTI; }
|
|
|
|
virtual const VectorTargetTransformInfo *getVectorTargetTransformInfo()const
|
|
|
|
{ return &VTTI; }
|
2010-10-21 11:57:26 +08:00
|
|
|
|
2010-02-24 03:15:24 +08:00
|
|
|
// Pass Pipeline Configuration
|
2012-02-04 10:56:59 +08:00
|
|
|
virtual TargetPassConfig *createPassConfig(PassManagerBase &PM);
|
2010-02-24 03:15:24 +08:00
|
|
|
};
|
|
|
|
} // End llvm namespace
|
|
|
|
|
|
|
|
#endif
|