24class NVPTXABIInfo :
public ABIInfo {
26 NVPTXABIInfo(CIRGenTypes &cgt) : ABIInfo(cgt) {}
31 NVPTXTargetCIRGenInfo(CIRGenTypes &cgt)
32 : TargetCIRGenInfo(std::make_unique<NVPTXABIInfo>(cgt)) {}
34 void setTargetAttributes(
const clang::Decl *
decl, mlir::Operation *global,
35 CIRGenModule &cgm)
const override {
36 auto globalValue = mlir::dyn_cast<cir::CIRGlobalValueInterface>(global);
37 if (globalValue && globalValue.isDeclaration())
40 const auto *vd = dyn_cast_or_null<VarDecl>(
decl);
43 if (vd->getType()->isCUDADeviceBuiltinSurfaceType() ||
44 vd->getType()->isCUDADeviceBuiltinTextureType())
50 const auto *fd = dyn_cast_or_null<FunctionDecl>(
decl);
54 auto func = mlir::cast<cir::FuncOp>(global);
60 if (fd->hasAttr<DeviceKernelAttr>() || fd->hasAttr<CUDAGlobalAttr>()) {
63 func.setInlineKind(cir::InlineKind::NoInline);
64 if (fd->hasAttr<CUDAGlobalAttr>()) {
65 func.setCallingConv(cir::CallingConv::PTXKernel);
68 if (fd->hasAttr<CUDALaunchBoundsAttr>())
74 mlir::Type getCUDADeviceBuiltinSurfaceDeviceType()
const override {
77 return cir::IntType::get(&getABIInfo().cgt.getMLIRContext(), 64,
84std::unique_ptr<TargetCIRGenInfo>
86 return std::make_unique<NVPTXTargetCIRGenInfo>(cgt);
const clang::LangOptions & getLangOpts() const
This class organizes the cross-module state that is used while lowering AST types to CIR types.
std::unique_ptr< TargetCIRGenInfo > createNVPTXTargetCIRGenInfo(CIRGenTypes &cgt)
const internal::VariadicAllOfMatcher< Decl > decl
Matches declarations.
The JSON file list parser is used to communicate input to InstallAPI.
static bool emitNVVMMetadata()
static bool handleCUDALaunchBoundsAttr()
static bool opFuncParameterAttributes()