2011-12-13 05:14:40 +08:00
|
|
|
//=-- HexagonTargetMachine.h - Define TargetMachine for Hexagon ---*- C++ -*-=//
|
|
|
|
//
|
|
|
|
// 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 Hexagon specific subclass of TargetMachine.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef HexagonTARGETMACHINE_H
|
|
|
|
#define HexagonTARGETMACHINE_H
|
|
|
|
|
2012-12-04 15:12:27 +08:00
|
|
|
#include "HexagonFrameLowering.h"
|
2011-12-13 05:14:40 +08:00
|
|
|
#include "HexagonISelLowering.h"
|
2012-12-04 15:12:27 +08:00
|
|
|
#include "HexagonInstrInfo.h"
|
2011-12-13 05:14:40 +08:00
|
|
|
#include "HexagonSelectionDAGInfo.h"
|
2012-12-04 15:12:27 +08:00
|
|
|
#include "HexagonSubtarget.h"
|
2013-01-02 19:36:10 +08:00
|
|
|
#include "llvm/IR/DataLayout.h"
|
2012-12-04 15:12:27 +08:00
|
|
|
#include "llvm/Target/TargetMachine.h"
|
2011-12-13 05:14:40 +08:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
class Module;
|
|
|
|
|
|
|
|
class HexagonTargetMachine : public LLVMTargetMachine {
|
2012-10-09 00:38:25 +08:00
|
|
|
const DataLayout DL; // Calculates type size & alignment.
|
2011-12-13 05:14:40 +08:00
|
|
|
HexagonSubtarget Subtarget;
|
|
|
|
HexagonInstrInfo InstrInfo;
|
2011-12-17 03:08:59 +08:00
|
|
|
HexagonTargetLowering TLInfo;
|
2011-12-13 05:14:40 +08:00
|
|
|
HexagonSelectionDAGInfo TSInfo;
|
|
|
|
HexagonFrameLowering FrameLowering;
|
|
|
|
const InstrItineraryData* InstrItins;
|
|
|
|
|
|
|
|
public:
|
|
|
|
HexagonTargetMachine(const Target &T, StringRef TT,StringRef CPU,
|
2012-03-17 17:24:09 +08:00
|
|
|
StringRef FS, const TargetOptions &Options,
|
|
|
|
Reloc::Model RM, CodeModel::Model CM,
|
|
|
|
CodeGenOpt::Level OL);
|
2011-12-13 05:14:40 +08:00
|
|
|
|
2014-04-29 15:58:16 +08:00
|
|
|
const HexagonInstrInfo *getInstrInfo() const override {
|
2011-12-13 05:14:40 +08:00
|
|
|
return &InstrInfo;
|
|
|
|
}
|
2014-04-29 15:58:16 +08:00
|
|
|
const HexagonSubtarget *getSubtargetImpl() const override {
|
2011-12-13 05:14:40 +08:00
|
|
|
return &Subtarget;
|
|
|
|
}
|
2014-04-29 15:58:16 +08:00
|
|
|
const HexagonRegisterInfo *getRegisterInfo() const override {
|
2011-12-13 05:14:40 +08:00
|
|
|
return &InstrInfo.getRegisterInfo();
|
|
|
|
}
|
|
|
|
|
2014-04-29 15:58:16 +08:00
|
|
|
const InstrItineraryData* getInstrItineraryData() const override {
|
2011-12-13 05:14:40 +08:00
|
|
|
return InstrItins;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-04-29 15:58:16 +08:00
|
|
|
const HexagonTargetLowering* getTargetLowering() const override {
|
2011-12-13 05:14:40 +08:00
|
|
|
return &TLInfo;
|
|
|
|
}
|
|
|
|
|
2014-04-29 15:58:16 +08:00
|
|
|
const HexagonFrameLowering* getFrameLowering() const override {
|
2011-12-13 05:14:40 +08:00
|
|
|
return &FrameLowering;
|
|
|
|
}
|
|
|
|
|
2014-04-29 15:58:16 +08:00
|
|
|
const HexagonSelectionDAGInfo* getSelectionDAGInfo() const override {
|
2011-12-13 05:14:40 +08:00
|
|
|
return &TSInfo;
|
|
|
|
}
|
|
|
|
|
2014-04-29 15:58:16 +08:00
|
|
|
const DataLayout *getDataLayout() const override { return &DL; }
|
2011-12-13 05:14:40 +08:00
|
|
|
static unsigned getModuleMatchQuality(const Module &M);
|
|
|
|
|
2014-04-29 15:58:16 +08:00
|
|
|
TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
|
2011-12-13 05:14:40 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
extern bool flag_aligned_memcpy;
|
|
|
|
|
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|