2012-12-12 05:25:42 +08:00
|
|
|
//===-- AMDGPUTargetMachine.h - AMDGPU TargetMachine Interface --*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
/// \file
|
|
|
|
/// \brief The AMDGPU TargetMachine interface definition for hw codgen targets.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-08-14 00:26:38 +08:00
|
|
|
#ifndef LLVM_LIB_TARGET_R600_AMDGPUTARGETMACHINE_H
|
|
|
|
#define LLVM_LIB_TARGET_R600_AMDGPUTARGETMACHINE_H
|
2012-12-12 05:25:42 +08:00
|
|
|
|
2013-02-07 01:32:29 +08:00
|
|
|
#include "AMDGPUFrameLowering.h"
|
2012-12-12 05:25:42 +08:00
|
|
|
#include "AMDGPUInstrInfo.h"
|
2014-06-24 02:00:31 +08:00
|
|
|
#include "AMDGPUIntrinsicInfo.h"
|
2012-12-12 05:25:42 +08:00
|
|
|
#include "AMDGPUSubtarget.h"
|
|
|
|
#include "R600ISelLowering.h"
|
2013-01-02 19:36:10 +08:00
|
|
|
#include "llvm/IR/DataLayout.h"
|
2012-12-12 05:25:42 +08:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
2015-01-07 02:00:21 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// AMDGPU Target Machine (R600+)
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2012-12-12 05:25:42 +08:00
|
|
|
class AMDGPUTargetMachine : public LLVMTargetMachine {
|
2015-01-29 00:04:26 +08:00
|
|
|
private:
|
|
|
|
|
2015-01-07 02:00:21 +08:00
|
|
|
protected:
|
2015-09-26 05:41:28 +08:00
|
|
|
std::unique_ptr<TargetLoweringObjectFile> TLOF;
|
2012-12-12 05:25:42 +08:00
|
|
|
AMDGPUSubtarget Subtarget;
|
2014-08-05 01:37:43 +08:00
|
|
|
AMDGPUIntrinsicInfo IntrinsicInfo;
|
2012-12-12 05:25:42 +08:00
|
|
|
|
|
|
|
public:
|
2015-06-12 03:41:26 +08:00
|
|
|
AMDGPUTargetMachine(const Target &T, const Triple &TT, StringRef FS,
|
2013-05-23 11:28:39 +08:00
|
|
|
StringRef CPU, TargetOptions Options, Reloc::Model RM,
|
|
|
|
CodeModel::Model CM, CodeGenOpt::Level OL);
|
|
|
|
~AMDGPUTargetMachine();
|
2015-03-12 08:07:24 +08:00
|
|
|
|
2015-03-21 12:22:23 +08:00
|
|
|
const AMDGPUSubtarget *getSubtargetImpl() const { return &Subtarget; }
|
|
|
|
const AMDGPUSubtarget *getSubtargetImpl(const Function &) const override {
|
2014-04-29 15:57:24 +08:00
|
|
|
return &Subtarget;
|
|
|
|
}
|
2014-09-03 19:41:21 +08:00
|
|
|
const AMDGPUIntrinsicInfo *getIntrinsicInfo() const override {
|
|
|
|
return &IntrinsicInfo;
|
|
|
|
}
|
2015-02-01 21:20:00 +08:00
|
|
|
TargetIRAnalysis getTargetIRAnalysis() override;
|
2015-01-31 19:17:59 +08:00
|
|
|
|
2014-11-13 17:26:31 +08:00
|
|
|
TargetLoweringObjectFile *getObjFileLowering() const override {
|
2015-09-26 05:41:28 +08:00
|
|
|
return TLOF.get();
|
2014-11-13 17:26:31 +08:00
|
|
|
}
|
2012-12-12 05:25:42 +08:00
|
|
|
};
|
|
|
|
|
2015-02-12 01:11:50 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// R600 Target Machine (R600 -> Cayman)
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
class R600TargetMachine : public AMDGPUTargetMachine {
|
|
|
|
|
|
|
|
public:
|
2015-06-12 03:41:26 +08:00
|
|
|
R600TargetMachine(const Target &T, const Triple &TT, StringRef FS,
|
2015-02-12 01:11:50 +08:00
|
|
|
StringRef CPU, TargetOptions Options, Reloc::Model RM,
|
|
|
|
CodeModel::Model CM, CodeGenOpt::Level OL);
|
2015-02-12 01:11:51 +08:00
|
|
|
|
|
|
|
TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
|
2015-02-12 01:11:50 +08:00
|
|
|
};
|
|
|
|
|
2015-01-07 02:00:21 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// GCN Target Machine (SI+)
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
class GCNTargetMachine : public AMDGPUTargetMachine {
|
|
|
|
|
|
|
|
public:
|
2015-06-12 03:41:26 +08:00
|
|
|
GCNTargetMachine(const Target &T, const Triple &TT, StringRef FS,
|
|
|
|
StringRef CPU, TargetOptions Options, Reloc::Model RM,
|
|
|
|
CodeModel::Model CM, CodeGenOpt::Level OL);
|
2015-02-12 01:11:51 +08:00
|
|
|
|
|
|
|
TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
|
2015-01-07 02:00:21 +08:00
|
|
|
};
|
|
|
|
|
2012-12-12 05:25:42 +08:00
|
|
|
} // End namespace llvm
|
|
|
|
|
2014-08-14 00:26:38 +08:00
|
|
|
#endif
|