#define GET_SUBTARGETINFO_ENUM
#define GET_SUBTARGETINFO_TARGET_DESC
+#define GET_SUBTARGETINFO_CTOR
#include "AMDGPUGenSubtargetInfo.inc"
AMDGPUSubtarget::AMDGPUSubtarget(StringRef TT, StringRef CPU, StringRef FS) :
- AMDILSubtarget(TT, CPU, FS) {
+ AMDGPUGenSubtargetInfo(TT, CPU, FS), mDumpCode(false) {
InstrItins = getInstrItineraryForCPU(CPU);
memset(CapsOverride, 0, sizeof(*CapsOverride)
* AMDILDeviceInfo::MaxNumberCapabilities);
// Default card
- std::string GPU = "rv770";
- GPU = CPU;
+ StringRef GPU = CPU;
mIs64bit = false;
- mVersion = 0;
- SmallVector<StringRef, DEFAULT_VEC_SLOTS> Features;
- SplitString(FS, Features, ",");
mDefaultSize[0] = 64;
mDefaultSize[1] = 1;
mDefaultSize[2] = 1;
- std::string newFeatures = "";
-#if defined(_DEBUG) || defined(DEBUG)
- bool useTest = false;
-#endif
- for (size_t x = 0; x < Features.size(); ++x) {
- if (Features[x].startswith("+mwgs")) {
- SmallVector<StringRef, DEFAULT_VEC_SLOTS> sizes;
- SplitString(Features[x], sizes, "-");
- size_t mDim = ::atoi(sizes[1].data());
- if (mDim > 3) {
- mDim = 3;
- }
- for (size_t y = 0; y < mDim; ++y) {
- mDefaultSize[y] = ::atoi(sizes[y+2].data());
- }
-#if defined(_DEBUG) || defined(DEBUG)
- } else if (!Features[x].compare("test")) {
- useTest = true;
-#endif
- } else if (Features[x].startswith("+cal")) {
- SmallVector<StringRef, DEFAULT_VEC_SLOTS> version;
- SplitString(Features[x], version, "=");
- mVersion = ::atoi(version[1].data());
- } else {
- GPU = CPU;
- if (x > 0) newFeatures += ',';
- newFeatures += Features[x];
- }
- }
- // If we don't have a version then set it to
- // -1 which enables everything. This is for
- // offline devices.
- if (!mVersion) {
- mVersion = (uint32_t)-1;
- }
- for (int x = 0; x < 3; ++x) {
- if (!mDefaultSize[x]) {
- mDefaultSize[x] = 1;
- }
- }
-#if defined(_DEBUG) || defined(DEBUG)
- if (useTest) {
- GPU = "kauai";
- }
-#endif
- ParseSubtargetFeatures(GPU, newFeatures);
-#if defined(_DEBUG) || defined(DEBUG)
- if (useTest) {
- GPU = "test";
- }
-#endif
+ ParseSubtargetFeatures(GPU, FS);
mDevName = GPU;
mDevice = AMDILDeviceInfo::getDeviceFromName(mDevName, this, mIs64bit);
}
+
+AMDGPUSubtarget::~AMDGPUSubtarget()
+{
+ delete mDevice;
+}
+
+bool
+AMDGPUSubtarget::isOverride(AMDILDeviceInfo::Caps caps) const
+{
+ assert(caps < AMDILDeviceInfo::MaxNumberCapabilities &&
+ "Caps index is out of bounds!");
+ return CapsOverride[caps];
+}
+bool
+AMDGPUSubtarget::is64bit() const
+{
+ return mIs64bit;
+}
+bool
+AMDGPUSubtarget::isTargetELF() const
+{
+ return false;
+}
+size_t
+AMDGPUSubtarget::getDefaultSize(uint32_t dim) const
+{
+ if (dim > 3) {
+ return 1;
+ } else {
+ return mDefaultSize[dim];
+ }
+}
+
+std::string
+AMDGPUSubtarget::getDataLayout() const
+{
+ if (!mDevice) {
+ return std::string("e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16"
+ "-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f80:32:32"
+ "-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64"
+ "-v96:128:128-v128:128:128-v192:256:256-v256:256:256"
+ "-v512:512:512-v1024:1024:1024-v2048:2048:2048-a0:0:64");
+ }
+ return mDevice->getDataLayout();
+}
+
+std::string
+AMDGPUSubtarget::getDeviceName() const
+{
+ return mDevName;
+}
+const AMDILDevice *
+AMDGPUSubtarget::device() const
+{
+ return mDevice;
+}
#ifndef _AMDGPUSUBTARGET_H_
#define _AMDGPUSUBTARGET_H_
-#include "AMDILSubtarget.h"
+#include "AMDILDevice.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
+#include "llvm/Target/TargetSubtargetInfo.h"
+
+#define GET_SUBTARGETINFO_HEADER
+#include "AMDGPUGenSubtargetInfo.inc"
+
+#define MAX_CB_SIZE (1 << 16)
namespace llvm {
-class AMDGPUSubtarget : public AMDILSubtarget
+class AMDGPUSubtarget : public AMDGPUGenSubtargetInfo
{
+private:
+ bool CapsOverride[AMDILDeviceInfo::MaxNumberCapabilities];
+ const AMDILDevice *mDevice;
+ size_t mDefaultSize[3];
+ size_t mMinimumSize[3];
+ std::string mDevName;
+ bool mIs64bit;
+ bool mIs32on64bit;
+ bool mDumpCode;
+
InstrItineraryData InstrItins;
public:
AMDGPUSubtarget(StringRef TT, StringRef CPU, StringRef FS);
+ virtual ~AMDGPUSubtarget();
const InstrItineraryData &getInstrItineraryData() const { return InstrItins; }
virtual void ParseSubtargetFeatures(llvm::StringRef CPU, llvm::StringRef FS);
+ bool isOverride(AMDILDeviceInfo::Caps) const;
+ bool is64bit() const;
+
+ // Helper functions to simplify if statements
+ bool isTargetELF() const;
+ const AMDILDevice* device() const;
+ std::string getDataLayout() const;
+ std::string getDeviceName() const;
+ virtual size_t getDefaultSize(uint32_t dim) const;
+ bool dumpCode() const { return mDumpCode; }
+
};
} // End namespace llvm
DisableVerify);
assert(fail);
- const AMDILSubtarget &STM = getSubtarget<AMDILSubtarget>();
+ const AMDGPUSubtarget &STM = getSubtarget<AMDGPUSubtarget>();
std::string gpu = STM.getDeviceName();
if (gpu == "SI") {
PM.add(createSICodeEmitterPass(Out));
bool
AMDGPUPassConfig::addPreISel()
{
- const AMDILSubtarget &ST = TM->getSubtarget<AMDILSubtarget>();
+ const AMDGPUSubtarget &ST = TM->getSubtarget<AMDGPUSubtarget>();
if (ST.device()->getGeneration() <= AMDILDeviceInfo::HD6XXX) {
PM->add(createR600KernelParametersPass(
getAMDGPUTargetMachine().getTargetData()));
}
bool AMDGPUPassConfig::addPreRegAlloc() {
- const AMDILSubtarget &ST = TM->getSubtarget<AMDILSubtarget>();
+ const AMDGPUSubtarget &ST = TM->getSubtarget<AMDGPUSubtarget>();
if (ST.device()->getGeneration() > AMDILDeviceInfo::HD6XXX) {
PM->add(createSIAssignInterpRegsPass(*TM));
//
//==-----------------------------------------------------------------------===//
#include "AMDIL7XXDevice.h"
+#include "AMDGPUSubtarget.h"
#ifdef UPSTREAM_LLVM
#include "AMDIL7XXAsmPrinter.h"
#endif
using namespace llvm;
-AMDIL7XXDevice::AMDIL7XXDevice(AMDILSubtarget *ST) : AMDILDevice(ST)
+AMDIL7XXDevice::AMDIL7XXDevice(AMDGPUSubtarget *ST) : AMDILDevice(ST)
{
setCaps();
std::string name = mSTM->getDeviceName();
#endif
}
-AMDIL770Device::AMDIL770Device(AMDILSubtarget *ST): AMDIL7XXDevice(ST)
+AMDIL770Device::AMDIL770Device(AMDGPUSubtarget *ST): AMDIL7XXDevice(ST)
{
setCaps();
}
return AMDILDevice::WavefrontSize;
}
-AMDIL710Device::AMDIL710Device(AMDILSubtarget *ST) : AMDIL7XXDevice(ST)
+AMDIL710Device::AMDIL710Device(AMDGPUSubtarget *ST) : AMDIL7XXDevice(ST)
{
}
#ifndef _AMDIL7XXDEVICEIMPL_H_
#define _AMDIL7XXDEVICEIMPL_H_
#include "AMDILDevice.h"
-#include "AMDILSubtarget.h"
namespace llvm {
-class AMDILSubtarget;
+class AMDGPUSubtarget;
//===----------------------------------------------------------------------===//
// 7XX generation of devices and their respective sub classes
// compliant and nothing more.
class AMDIL7XXDevice : public AMDILDevice {
public:
- AMDIL7XXDevice(AMDILSubtarget *ST);
+ AMDIL7XXDevice(AMDGPUSubtarget *ST);
virtual ~AMDIL7XXDevice();
virtual size_t getMaxLDSSize() const;
virtual size_t getWavefrontSize() const;
// and has a larger wavefront size.
class AMDIL770Device : public AMDIL7XXDevice {
public:
- AMDIL770Device(AMDILSubtarget *ST);
+ AMDIL770Device(AMDGPUSubtarget *ST);
virtual ~AMDIL770Device();
virtual size_t getWavefrontSize() const;
private:
// functions in order to correctly specify this information.
class AMDIL710Device : public AMDIL7XXDevice {
public:
- AMDIL710Device(AMDILSubtarget *ST);
+ AMDIL710Device(AMDGPUSubtarget *ST);
virtual ~AMDIL710Device();
virtual size_t getWavefrontSize() const;
}; // AMDIL710Device
//
//==-----------------------------------------------------------------------===//
#include "AMDILDevice.h"
-#include "AMDILSubtarget.h"
+#include "AMDGPUSubtarget.h"
using namespace llvm;
// Default implementation for all of the classes.
-AMDILDevice::AMDILDevice(AMDILSubtarget *ST) : mSTM(ST)
+AMDILDevice::AMDILDevice(AMDGPUSubtarget *ST) : mSTM(ST)
{
mHWBits.resize(AMDILDeviceInfo::MaxNumberCapabilities);
mSWBits.resize(AMDILDeviceInfo::MaxNumberCapabilities);
#include "llvm/ADT/BitVector.h"
namespace llvm {
- class AMDILSubtarget;
+ class AMDGPUSubtarget;
class AMDILAsmPrinter;
class AMDILPointerManager;
class AsmPrinter;
//===----------------------------------------------------------------------===//
class AMDILDevice {
public:
- AMDILDevice(AMDILSubtarget *ST);
+ AMDILDevice(AMDGPUSubtarget *ST);
virtual ~AMDILDevice();
// Enum values for the various memory types.
virtual void setCaps();
llvm::BitVector mHWBits;
llvm::BitVector mSWBits;
- AMDILSubtarget *mSTM;
+ AMDGPUSubtarget *mSTM;
uint32_t mDeviceFlag;
private:
AMDILDeviceInfo::ExecutionMode
//
//==-----------------------------------------------------------------------===//
#include "AMDILDevices.h"
-#include "AMDILSubtarget.h"
+#include "AMDGPUSubtarget.h"
using namespace llvm;
namespace llvm {
namespace AMDILDeviceInfo {
AMDILDevice*
-getDeviceFromName(const std::string &deviceName, AMDILSubtarget *ptr, bool is64bit, bool is64on32bit)
+getDeviceFromName(const std::string &deviceName, AMDGPUSubtarget *ptr,
+ bool is64bit, bool is64on32bit)
{
if (deviceName.c_str()[2] == '7') {
switch (deviceName.c_str()[3]) {
namespace llvm
{
class AMDILDevice;
- class AMDILSubtarget;
+ class AMDGPUSubtarget;
namespace AMDILDeviceInfo
{
// Each Capabilities can be executed using a hardware instruction,
AMDILDevice*
- getDeviceFromName(const std::string &name, AMDILSubtarget *ptr, bool is64bit = false, bool is64on32bit = false);
+ getDeviceFromName(const std::string &name, AMDGPUSubtarget *ptr,
+ bool is64bit = false, bool is64on32bit = false);
} // namespace AMDILDeviceInfo
} // namespace llvm
#endif // _AMDILDEVICEINFO_H_
using namespace llvm;
-AMDILEvergreenDevice::AMDILEvergreenDevice(AMDILSubtarget *ST)
+AMDILEvergreenDevice::AMDILEvergreenDevice(AMDGPUSubtarget *ST)
: AMDILDevice(ST) {
setCaps();
std::string name = ST->getDeviceName();
break;
case CONSTANT_ID:
case RAW_UAV_ID:
- if (mSTM->calVersion() >= CAL_VERSION_GLOBAL_RETURN_BUFFER) {
- return GLOBAL_RETURN_RAW_UAV_ID;
- } else {
- return DEFAULT_RAW_UAV_ID;
- }
+ return GLOBAL_RETURN_RAW_UAV_ID;
case GLOBAL_ID:
case ARENA_UAV_ID:
return DEFAULT_ARENA_UAV_ID;
void AMDILEvergreenDevice::setCaps() {
mSWBits.set(AMDILDeviceInfo::ArenaSegment);
mHWBits.set(AMDILDeviceInfo::ArenaUAV);
- if (mSTM->calVersion() >= CAL_VERSION_SC_140) {
- mHWBits.set(AMDILDeviceInfo::HW64BitDivMod);
- mSWBits.reset(AMDILDeviceInfo::HW64BitDivMod);
- }
+ mHWBits.set(AMDILDeviceInfo::HW64BitDivMod);
+ mSWBits.reset(AMDILDeviceInfo::HW64BitDivMod);
mSWBits.set(AMDILDeviceInfo::Signed24BitOps);
if (mSTM->isOverride(AMDILDeviceInfo::ByteStores)) {
mHWBits.set(AMDILDeviceInfo::ByteStores);
if (mSTM->isOverride(AMDILDeviceInfo::NoAlias)) {
mHWBits.set(AMDILDeviceInfo::NoAlias);
}
- if (mSTM->calVersion() > CAL_VERSION_GLOBAL_RETURN_BUFFER) {
- mHWBits.set(AMDILDeviceInfo::CachedMem);
- }
+ mHWBits.set(AMDILDeviceInfo::CachedMem);
if (mSTM->isOverride(AMDILDeviceInfo::MultiUAV)) {
mHWBits.set(AMDILDeviceInfo::MultiUAV);
}
- if (mSTM->calVersion() > CAL_VERSION_SC_136) {
- mHWBits.set(AMDILDeviceInfo::ByteLDSOps);
- mSWBits.reset(AMDILDeviceInfo::ByteLDSOps);
- mHWBits.set(AMDILDeviceInfo::ArenaVectors);
- } else {
- mSWBits.set(AMDILDeviceInfo::ArenaVectors);
- }
- if (mSTM->calVersion() > CAL_VERSION_SC_137) {
- mHWBits.set(AMDILDeviceInfo::LongOps);
- mSWBits.reset(AMDILDeviceInfo::LongOps);
- }
+ mHWBits.set(AMDILDeviceInfo::ByteLDSOps);
+ mSWBits.reset(AMDILDeviceInfo::ByteLDSOps);
+ mHWBits.set(AMDILDeviceInfo::ArenaVectors);
+ mHWBits.set(AMDILDeviceInfo::LongOps);
+ mSWBits.reset(AMDILDeviceInfo::LongOps);
mHWBits.set(AMDILDeviceInfo::TmrReg);
}
#endif
}
-AMDILCypressDevice::AMDILCypressDevice(AMDILSubtarget *ST)
+AMDILCypressDevice::AMDILCypressDevice(AMDGPUSubtarget *ST)
: AMDILEvergreenDevice(ST) {
setCaps();
}
}
-AMDILCedarDevice::AMDILCedarDevice(AMDILSubtarget *ST)
+AMDILCedarDevice::AMDILCedarDevice(AMDGPUSubtarget *ST)
: AMDILEvergreenDevice(ST) {
setCaps();
}
return AMDILDevice::QuarterWavefrontSize;
}
-AMDILRedwoodDevice::AMDILRedwoodDevice(AMDILSubtarget *ST)
+AMDILRedwoodDevice::AMDILRedwoodDevice(AMDGPUSubtarget *ST)
: AMDILEvergreenDevice(ST) {
setCaps();
}
#ifndef _AMDILEVERGREENDEVICE_H_
#define _AMDILEVERGREENDEVICE_H_
#include "AMDILDevice.h"
-#include "AMDILSubtarget.h"
+#include "AMDGPUSubtarget.h"
namespace llvm {
- class AMDILSubtarget;
+ class AMDGPUSubtarget;
//===----------------------------------------------------------------------===//
// Evergreen generation of devices and their respective sub classes
//===----------------------------------------------------------------------===//
// that capabilities of the 'Juniper' cards, also known as the HD57XX.
class AMDILEvergreenDevice : public AMDILDevice {
public:
- AMDILEvergreenDevice(AMDILSubtarget *ST);
+ AMDILEvergreenDevice(AMDGPUSubtarget *ST);
virtual ~AMDILEvergreenDevice();
virtual size_t getMaxLDSSize() const;
virtual size_t getMaxGDSSize() const;
// and HD59XX cards.
class AMDILCypressDevice : public AMDILEvergreenDevice {
public:
- AMDILCypressDevice(AMDILSubtarget *ST);
+ AMDILCypressDevice(AMDGPUSubtarget *ST);
virtual ~AMDILCypressDevice();
private:
virtual void setCaps();
// HD54XX and HD53XX series of cards.
class AMDILCedarDevice : public AMDILEvergreenDevice {
public:
- AMDILCedarDevice(AMDILSubtarget *ST);
+ AMDILCedarDevice(AMDGPUSubtarget *ST);
virtual ~AMDILCedarDevice();
virtual size_t getWavefrontSize() const;
private:
// the HD55XX and HD56XX series of cards.
class AMDILRedwoodDevice : public AMDILEvergreenDevice {
public:
- AMDILRedwoodDevice(AMDILSubtarget *ST);
+ AMDILRedwoodDevice(AMDGPUSubtarget *ST);
virtual ~AMDILRedwoodDevice();
virtual size_t getWavefrontSize() const;
private:
class AMDILDAGToDAGISel : public SelectionDAGISel {
// Subtarget - Keep a pointer to the AMDIL Subtarget around so that we can
// make the right decision when generating code for different targets.
- const AMDILSubtarget &Subtarget;
+ const AMDGPUSubtarget &Subtarget;
public:
AMDILDAGToDAGISel(TargetMachine &TM AMDIL_OPT_LEVEL_DECL);
virtual ~AMDILDAGToDAGISel();
AMDILDAGToDAGISel::AMDILDAGToDAGISel(TargetMachine &TM
AMDIL_OPT_LEVEL_DECL)
- : SelectionDAGISel(TM AMDIL_OPT_LEVEL_VAR), Subtarget(TM.getSubtarget<AMDILSubtarget>())
+ : SelectionDAGISel(TM AMDIL_OPT_LEVEL_VAR), Subtarget(TM.getSubtarget<AMDGPUSubtarget>())
{
}
#include "AMDGPURegisterInfo.h"
#include "AMDILDevices.h"
#include "AMDILIntrinsicInfo.h"
-#include "AMDILSubtarget.h"
+#include "AMDGPUSubtarget.h"
#include "AMDILUtilityFunctions.h"
#include "llvm/CallingConv.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
size_t numIntTypes = sizeof(IntTypes) / sizeof(*IntTypes);
size_t numVectorTypes = sizeof(VectorTypes) / sizeof(*VectorTypes);
- const AMDILSubtarget &STM = getTargetMachine().getSubtarget<AMDILSubtarget>();
+ const AMDGPUSubtarget &STM = getTargetMachine().getSubtarget<AMDGPUSubtarget>();
// These are the current register classes that are
// supported
#include "AMDILIntrinsicInfo.h"
#include "AMDIL.h"
-#include "AMDILSubtarget.h"
+#include "AMDGPUSubtarget.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Intrinsics.h"
#include "llvm/Module.h"
//==-----------------------------------------------------------------------===//
#include "AMDILNIDevice.h"
#include "AMDILEvergreenDevice.h"
-#include "AMDILSubtarget.h"
+#include "AMDGPUSubtarget.h"
using namespace llvm;
-AMDILNIDevice::AMDILNIDevice(AMDILSubtarget *ST)
+AMDILNIDevice::AMDILNIDevice(AMDGPUSubtarget *ST)
: AMDILEvergreenDevice(ST)
{
std::string name = ST->getDeviceName();
}
-AMDILCaymanDevice::AMDILCaymanDevice(AMDILSubtarget *ST)
+AMDILCaymanDevice::AMDILCaymanDevice(AMDGPUSubtarget *ST)
: AMDILNIDevice(ST)
{
setCaps();
#ifndef _AMDILNIDEVICE_H_
#define _AMDILNIDEVICE_H_
#include "AMDILEvergreenDevice.h"
-#include "AMDILSubtarget.h"
+#include "AMDGPUSubtarget.h"
namespace llvm {
- class AMDILSubtarget;
+ class AMDGPUSubtarget;
//===---------------------------------------------------------------------===//
// NI generation of devices and their respective sub classes
//===---------------------------------------------------------------------===//
class AMDILNIDevice : public AMDILEvergreenDevice {
public:
- AMDILNIDevice(AMDILSubtarget*);
+ AMDILNIDevice(AMDGPUSubtarget*);
virtual ~AMDILNIDevice();
virtual size_t getMaxLDSSize() const;
virtual uint32_t getGeneration() const;
class AMDILCaymanDevice: public AMDILNIDevice {
public:
- AMDILCaymanDevice(AMDILSubtarget*);
+ AMDILCaymanDevice(AMDGPUSubtarget*);
virtual ~AMDILCaymanDevice();
private:
virtual void setCaps();
LLVMContext *mCTX;
Function *mF;
- const AMDILSubtarget *mSTM;
+ const AMDGPUSubtarget *mSTM;
SmallVector< std::pair<CallInst *, Function *>, 16> atomicFuncs;
SmallVector<CallInst *, 16> isConstVec;
}; // class AMDILPeepholeOpt
{
mChanged = false;
mF = &MF;
- mSTM = &TM.getSubtarget<AMDILSubtarget>();
+ mSTM = &TM.getSubtarget<AMDGPUSubtarget>();
if (mDebug) {
MF.dump();
}
bool
AMDILPeepholeOpt::expandBFI(CallInst *CI)
{
- if (!CI || mSTM->calVersion() <= CAL_VERSION_SC_150) {
+ if (!CI) {
return false;
}
Value *LHS = CI->getOperand(CI->getNumOperands() - 1);
bool
AMDILPeepholeOpt::expandBFM(CallInst *CI)
{
- if (!CI || mSTM->calVersion() <= CAL_VERSION_SC_150) {
+ if (!CI) {
return false;
}
Value *LHS = CI->getOperand(CI->getNumOperands() - 1);
#include "AMDILSIDevice.h"
#include "AMDILEvergreenDevice.h"
#include "AMDILNIDevice.h"
-#include "AMDILSubtarget.h"
+#include "AMDGPUSubtarget.h"
using namespace llvm;
-AMDILSIDevice::AMDILSIDevice(AMDILSubtarget *ST)
+AMDILSIDevice::AMDILSIDevice(AMDGPUSubtarget *ST)
: AMDILEvergreenDevice(ST)
{
}
#ifndef _AMDILSIDEVICE_H_
#define _AMDILSIDEVICE_H_
#include "AMDILEvergreenDevice.h"
-#include "AMDILSubtarget.h"
+#include "AMDGPUSubtarget.h"
namespace llvm {
- class AMDILSubtarget;
+ class AMDGPUSubtarget;
//===---------------------------------------------------------------------===//
// SI generation of devices and their respective sub classes
//===---------------------------------------------------------------------===//
class AMDILSIDevice : public AMDILEvergreenDevice {
public:
- AMDILSIDevice(AMDILSubtarget*);
+ AMDILSIDevice(AMDGPUSubtarget*);
virtual ~AMDILSIDevice();
virtual size_t getMaxLDSSize() const;
virtual uint32_t getGeneration() const;
+++ /dev/null
-//===- AMDILSubtarget.cpp - AMDIL Subtarget Information -------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//==-----------------------------------------------------------------------===//
-//
-// This file implements the AMD IL specific subclass of TargetSubtarget.
-//
-//===----------------------------------------------------------------------===//
-
-#include "AMDILSubtarget.h"
-#include "AMDIL.h"
-#include "AMDILDevices.h"
-#include "AMDILUtilityFunctions.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/MC/SubtargetFeature.h"
-
-using namespace llvm;
-
-#define GET_SUBTARGETINFO_CTOR
-#include "AMDGPUGenSubtargetInfo.inc"
-
-AMDILSubtarget::AMDILSubtarget(llvm::StringRef TT, llvm::StringRef CPU, llvm::StringRef FS) : AMDGPUGenSubtargetInfo( TT, CPU, FS ),
- mDumpCode(false)
-{
-}
-AMDILSubtarget::~AMDILSubtarget()
-{
- delete mDevice;
-}
-bool
-AMDILSubtarget::isOverride(AMDILDeviceInfo::Caps caps) const
-{
- assert(caps < AMDILDeviceInfo::MaxNumberCapabilities &&
- "Caps index is out of bounds!");
- return CapsOverride[caps];
-}
-bool
-AMDILSubtarget::is64bit() const
-{
- return mIs64bit;
-}
-bool
-AMDILSubtarget::isTargetELF() const
-{
- return false;
-}
-size_t
-AMDILSubtarget::getDefaultSize(uint32_t dim) const
-{
- if (dim > 3) {
- return 1;
- } else {
- return mDefaultSize[dim];
- }
-}
-uint32_t
-AMDILSubtarget::calVersion() const
-{
- return mVersion;
-}
-
-AMDILGlobalManager*
-AMDILSubtarget::getGlobalManager() const
-{
- return mGM;
-}
-void
-AMDILSubtarget::setGlobalManager(AMDILGlobalManager *gm) const
-{
- mGM = gm;
-}
-
-AMDILKernelManager*
-AMDILSubtarget::getKernelManager() const
-{
- return mKM;
-}
-void
-AMDILSubtarget::setKernelManager(AMDILKernelManager *km) const
-{
- mKM = km;
-}
-std::string
-AMDILSubtarget::getDataLayout() const
-{
- if (!mDevice) {
- return std::string("e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16"
- "-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f80:32:32"
- "-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64"
- "-v96:128:128-v128:128:128-v192:256:256-v256:256:256"
- "-v512:512:512-v1024:1024:1024-v2048:2048:2048-a0:0:64");
- }
- return mDevice->getDataLayout();
-}
-
-std::string
-AMDILSubtarget::getDeviceName() const
-{
- return mDevName;
-}
-const AMDILDevice *
-AMDILSubtarget::device() const
-{
- return mDevice;
-}
+++ /dev/null
-//=====-- AMDILSubtarget.h - Define Subtarget for the AMDIL ----*- 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 AMDIL specific subclass of TargetSubtarget.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _AMDILSUBTARGET_H_
-#define _AMDILSUBTARGET_H_
-
-#include "AMDILDevice.h"
-#include "llvm/ADT/BitVector.h"
-#include "llvm/Target/TargetSubtargetInfo.h"
-
-#include <cstdlib>
-#include <string>
-
-#define GET_SUBTARGETINFO_HEADER
-#include "AMDGPUGenSubtargetInfo.inc"
-
-#define MAX_CB_SIZE (1 << 16)
-namespace llvm {
- class Module;
- class AMDILKernelManager;
- class AMDILGlobalManager;
- class AMDILDevice;
- class AMDILSubtarget : public AMDGPUGenSubtargetInfo {
- protected:
- bool CapsOverride[AMDILDeviceInfo::MaxNumberCapabilities];
- mutable AMDILGlobalManager *mGM;
- mutable AMDILKernelManager *mKM;
- const AMDILDevice *mDevice;
- size_t mDefaultSize[3];
- size_t mMinimumSize[3];
- std::string mDevName;
- uint32_t mVersion;
- bool mIs64bit;
- bool mIs32on64bit;
- bool mDumpCode;
- public:
- AMDILSubtarget(llvm::StringRef TT, llvm::StringRef CPU, llvm::StringRef FS);
- virtual ~AMDILSubtarget();
- bool isOverride(AMDILDeviceInfo::Caps) const;
- bool is64bit() const;
-
- // Helper functions to simplify if statements
- bool isTargetELF() const;
- AMDILGlobalManager* getGlobalManager() const;
- void setGlobalManager(AMDILGlobalManager *gm) const;
- AMDILKernelManager* getKernelManager() const;
- void setKernelManager(AMDILKernelManager *gm) const;
- const AMDILDevice* device() const;
- std::string getDataLayout() const;
- std::string getDeviceName() const;
- virtual size_t getDefaultSize(uint32_t dim) const;
- // Return the version of CAL that the backend should target.
- uint32_t calVersion() const;
- // ParseSubtargetFeatures - Parses features string setting specified
- // subtarget options. Definition of function is
- //auto generated by tblgen.
- virtual void
- ParseSubtargetFeatures(
- llvm::StringRef CPU,
- llvm::StringRef FS) { assert(!"Unimplemented"); }
- bool dumpCode() const { return mDumpCode; }
-
- };
-
-} // end namespace llvm
-
-#endif // AMDILSUBTARGET_H_
AMDILNIDevice.cpp \
AMDILPeepholeOptimizer.cpp \
AMDILSIDevice.cpp \
- AMDILSubtarget.cpp \
AMDGPUSubtarget.cpp \
AMDGPUTargetMachine.cpp \
AMDGPUISelLowering.cpp \
MRI = &MF.getRegInfo();
TRI = static_cast<const R600RegisterInfo *>(TM->getRegisterInfo());
const R600InstrInfo * TII = static_cast<const R600InstrInfo *>(TM->getInstrInfo());
- const AMDILSubtarget &STM = TM->getSubtarget<AMDILSubtarget>();
+ const AMDGPUSubtarget &STM = TM->getSubtarget<AMDGPUSubtarget>();
std::string gpu = STM.getDeviceName();
if (STM.dumpCode()) {
#include "R600InstrInfo.h"
#include "AMDGPUTargetMachine.h"
-#include "AMDILSubtarget.h"
+#include "AMDGPUSubtarget.h"
#include "R600RegisterInfo.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
const ScheduleDAG *DAG) const
{
const InstrItineraryData *II = TM->getInstrItineraryData();
- return TM->getSubtarget<AMDILSubtarget>().createDFAPacketizer(II);
+ return TM->getSubtarget<AMDGPUSubtarget>().createDFAPacketizer(II);
}
bool SICodeEmitter::runOnMachineFunction(MachineFunction &MF)
{
TM = &MF.getTarget();
- const AMDILSubtarget &STM = TM->getSubtarget<AMDILSubtarget>();
+ const AMDGPUSubtarget &STM = TM->getSubtarget<AMDGPUSubtarget>();
if (STM.dumpCode()) {
MF.dump();