14#ifndef LLVM_CLANG_LIB_CIR_TARGETINFO_H
15#define LLVM_CLANG_LIB_CIR_TARGETINFO_H
19#include "mlir/Dialect/Ptr/IR/MemorySpaceInterfaces.h"
47 std::unique_ptr<ABIInfo> info;
69 return cir::LangAddressSpaceAttr::get(&info->cgt.getMLIRContext(),
70 cir::LangAddressSpace::Default);
75 virtual mlir::ptr::MemorySpaceAttrInterface
83 QualType qt, mlir::Location loc)
const;
161 mlir::Operation *global,
165 mlir::Type ty)
const {
181 llvm::StringRef constraint,
182 mlir::Type ty)
const {
187std::unique_ptr<TargetCIRGenInfo>
192 cir::FuncOp func, CIRGenModule &cgm);
196std::unique_ptr<TargetCIRGenInfo>
201std::unique_ptr<TargetCIRGenInfo>
Provides definitions for the various language-specific address spaces.
This class organizes the cross-function state that is used while generating CIR code.
virtual ~TargetCIRGenInfo()=default
virtual mlir::Type adjustInlineAsmType(CIRGenFunction &cgf, llvm::StringRef constraint, mlir::Type ty) const
Corrects the MLIR type for a given constraint and "usual" type.
virtual mlir::Value getNullPointer(CIRGenModule &cgm, cir::PointerType ptrTy, QualType qt, mlir::Location loc) const
Get the CIR value of a null pointer of type ptrTy, where qt is the source pointer type.
const ABIInfo & getABIInfo() const
Returns ABI info helper for the target.
TargetCIRGenInfo(std::unique_ptr< ABIInfo > info)
virtual bool supportsLibCall() const
Returns true if the target supports math library calls.
virtual clang::LangAS getGlobalVarAddressSpace(CIRGenModule &cgm, const clang::VarDecl *d) const
Get target favored AST address space of a global variable for languages other than OpenCL and CUDA.
virtual bool isScalarizableAsmOperand(CIRGenFunction &cgf, mlir::Type ty) const
virtual mlir::ptr::MemorySpaceAttrInterface getGlobalCIRAddressSpace(clang::LangAS as) const
Get the CIR address space attribute for a global in AST address space as.
virtual cir::CallingConv getDeviceKernelCallingConv() const
Returns the calling convention used for device kernels on this target.
virtual bool isNoProtoCallVariadic(const FunctionNoProtoType *fnType) const
Determine whether a call to an unprototyped functions under the given calling convention should use t...
virtual mlir::Type getCUDADeviceBuiltinSurfaceDeviceType() const
virtual mlir::ptr::MemorySpaceAttrInterface getCIRAllocaAddressSpace() const
Get the address space for alloca.
virtual void setCUDAKernelCallingConvention(const clang::FunctionType *&ft) const
virtual bool wouldInliningViolateFunctionCallABI(const FunctionDecl *Caller, const FunctionDecl *Callee) const
Returns true if inlining the function call would produce incorrect code for the current target and sh...
virtual void setTargetAttributes(const clang::Decl *decl, mlir::Operation *global, CIRGenModule &module) const
Provides a convenient hook to handle extra target-specific attributes for the given global.
virtual mlir::Type getCUDADeviceBuiltinTextureDeviceType() const
Decl - This represents one declaration (or definition), e.g.
Represents a function declaration or definition.
Represents a K&R-style 'int foo()' function, which has no information available about its arguments.
FunctionType - C99 6.7.5.3 - Function Declarators.
A (possibly-)qualified type.
Represents a variable declaration or definition.
mlir::ptr::MemorySpaceAttrInterface toCIRAddressSpaceAttr(mlir::MLIRContext &ctx, clang::LangAS langAS)
Convert an AST LangAS to the appropriate CIR address space attribute interface.
void setAMDGPUTargetFunctionAttributes(const clang::Decl *decl, cir::FuncOp func, CIRGenModule &cgm)
Set AMDGPU-specific function attributes for HIP kernels.
bool isEmptyRecordForABI(const ASTContext &context, QualType t)
isEmptyRecordForABI - Return true if a structure contains only empty base classes and fields.
std::unique_ptr< TargetCIRGenInfo > createAMDGPUTargetCIRGenInfo(CIRGenTypes &cgt)
std::unique_ptr< TargetCIRGenInfo > createNVPTXTargetCIRGenInfo(CIRGenTypes &cgt)
bool isEmptyFieldForABI(const ASTContext &context, const FieldDecl *fd)
isEmptyFieldForABI - Return true if the field is "empty", that is, it is a zero-width bit-field or an...
std::unique_ptr< TargetCIRGenInfo > createX8664TargetCIRGenInfo(CIRGenTypes &cgt)
std::unique_ptr< TargetCIRGenInfo > createCommonSPIRTargetCIRGenInfo(CIRGenTypes &cgt)
std::unique_ptr< TargetCIRGenInfo > createAArch64TargetCIRGenInfo(CIRGenTypes &cgt)
const internal::VariadicAllOfMatcher< Decl > decl
Matches declarations.
LangAS
Defines the address space values used by the address space qualifier of QualType.