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 "HexagonInstrInfo.h"
|
|
|
|
#include "HexagonSubtarget.h"
|
|
|
|
#include "llvm/Target/TargetMachine.h"
|
2011-12-13 05:14:40 +08:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
class Module;
|
|
|
|
|
|
|
|
class HexagonTargetMachine : public LLVMTargetMachine {
|
|
|
|
HexagonSubtarget Subtarget;
|
|
|
|
|
|
|
|
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 {
|
2014-06-27 08:27:40 +08:00
|
|
|
return getSubtargetImpl()->getInstrInfo();
|
2011-12-13 05:14:40 +08:00
|
|
|
}
|
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 {
|
2014-06-27 08:27:40 +08:00
|
|
|
return getSubtargetImpl()->getRegisterInfo();
|
2011-12-13 05:14:40 +08:00
|
|
|
}
|
2014-04-29 15:58:16 +08:00
|
|
|
const InstrItineraryData* getInstrItineraryData() const override {
|
2014-06-27 08:13:43 +08:00
|
|
|
return &getSubtargetImpl()->getInstrItineraryData();
|
2011-12-13 05:14:40 +08:00
|
|
|
}
|
2014-04-29 15:58:16 +08:00
|
|
|
const HexagonTargetLowering* getTargetLowering() const override {
|
2014-06-27 08:27:40 +08:00
|
|
|
return getSubtargetImpl()->getTargetLowering();
|
2011-12-13 05:14:40 +08:00
|
|
|
}
|
2014-04-29 15:58:16 +08:00
|
|
|
const HexagonFrameLowering* getFrameLowering() const override {
|
2014-06-27 08:27:40 +08:00
|
|
|
return getSubtargetImpl()->getFrameLowering();
|
2011-12-13 05:14:40 +08:00
|
|
|
}
|
2014-04-29 15:58:16 +08:00
|
|
|
const HexagonSelectionDAGInfo* getSelectionDAGInfo() const override {
|
2014-06-27 08:27:40 +08:00
|
|
|
return getSubtargetImpl()->getSelectionDAGInfo();
|
|
|
|
}
|
|
|
|
const DataLayout *getDataLayout() const override {
|
|
|
|
return getSubtargetImpl()->getDataLayout();
|
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
|