1 //=====-- AMDILSubtarget.h - Define Subtarget for the AMDIL ----*- C++ -*-====//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //==-----------------------------------------------------------------------===//
10 // This file declares the AMDIL specific subclass of TargetSubtarget.
12 //===----------------------------------------------------------------------===//
14 #ifndef _AMDILSUBTARGET_H_
15 #define _AMDILSUBTARGET_H_
17 #include "AMDILDevice.h"
18 #include "llvm/ADT/BitVector.h"
19 #include "llvm/Target/TargetSubtargetInfo.h"
24 #define GET_SUBTARGETINFO_HEADER
25 #include "AMDGPUGenSubtargetInfo.inc"
27 #define MAX_CB_SIZE (1 << 16)
30 class AMDILKernelManager;
31 class AMDILGlobalManager;
33 class AMDILSubtarget : public AMDILGenSubtargetInfo {
35 bool CapsOverride[AMDILDeviceInfo::MaxNumberCapabilities];
36 mutable AMDILGlobalManager *mGM;
37 mutable AMDILKernelManager *mKM;
38 const AMDILDevice *mDevice;
39 size_t mDefaultSize[3];
46 AMDILSubtarget(llvm::StringRef TT, llvm::StringRef CPU, llvm::StringRef FS);
47 virtual ~AMDILSubtarget();
48 bool isOverride(AMDILDeviceInfo::Caps) const;
51 // Helper functions to simplify if statements
52 bool isTargetELF() const;
53 AMDILGlobalManager* getGlobalManager() const;
54 void setGlobalManager(AMDILGlobalManager *gm) const;
55 AMDILKernelManager* getKernelManager() const;
56 void setKernelManager(AMDILKernelManager *gm) const;
57 const AMDILDevice* device() const;
58 std::string getDataLayout() const;
59 std::string getDeviceName() const;
60 virtual size_t getDefaultSize(uint32_t dim) const;
61 // Return the version of CAL that the backend should target.
62 uint32_t calVersion() const;
63 // ParseSubtargetFeatures - Parses features string setting specified
64 // subtarget options. Definition of function is
65 //auto generated by tblgen.
67 ParseSubtargetFeatures(
70 bool dumpCode() const { return mDumpCode; }
74 } // end namespace llvm
76 #endif // AMDILSUBTARGET_H_