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];
40 size_t mMinimumSize
[3];
47 AMDILSubtarget(llvm::StringRef TT
, llvm::StringRef CPU
, llvm::StringRef FS
);
48 virtual ~AMDILSubtarget();
49 bool isOverride(AMDILDeviceInfo::Caps
) const;
52 // Helper functions to simplify if statements
53 bool isTargetELF() const;
54 AMDILGlobalManager
* getGlobalManager() const;
55 void setGlobalManager(AMDILGlobalManager
*gm
) const;
56 AMDILKernelManager
* getKernelManager() const;
57 void setKernelManager(AMDILKernelManager
*gm
) const;
58 const AMDILDevice
* device() const;
59 std::string
getDataLayout() const;
60 std::string
getDeviceName() const;
61 virtual size_t getDefaultSize(uint32_t dim
) const;
62 // Return the version of CAL that the backend should target.
63 uint32_t calVersion() const;
64 // ParseSubtargetFeatures - Parses features string setting specified
65 // subtarget options. Definition of function is
66 //auto generated by tblgen.
68 ParseSubtargetFeatures(
71 bool dumpCode() const { return mDumpCode
; }
75 } // end namespace llvm
77 #endif // AMDILSUBTARGET_H_