21 return llvm::cast<cir::GetGlobalOp>(op).getNameAttr();
25 return llvm::cast<cir::GlobalOp>(op).getConstant();
29 return llvm::cast<cir::GlobalOp>(op).hasInitializer();
33 mlir::Region &ctorRegion = llvm::cast<cir::GlobalOp>(op).getCtorRegion();
34 return ctorRegion.empty() ? nullptr : &ctorRegion;
42 auto lang = llvm::dyn_cast_if_present<cir::LangAddressSpaceAttr>(
43 llvm::cast<cir::GlobalOp>(op).getAddrSpaceAttr());
48 auto lang = llvm::dyn_cast_if_present<cir::LangAddressSpaceAttr>(
49 llvm::cast<cir::GlobalOp>(op).getAddrSpaceAttr());
58 llvm::StringRef name = llvm::cast<cir::GlobalOp>(op).getSymName();
59 return name.starts_with(
".") || name.starts_with(
"__");
63 return llvm::cast<cir::GlobalOp>(op).hasLocalLinkage();
bool isDeviceResidentAddressSpace(cir::LangAddressSpace space)
Returns true if storage in space physically resides on the device.
bool isDeviceAccessibleAddressSpace(cir::LangAddressSpace space)
Returns true if code on the device can reach storage in space.
mlir::SymbolRefAttr getSymbol(mlir::Operation *op) const
bool isInDeviceMemory(mlir::Operation *op) const
bool hasInitializer(mlir::Operation *op) const
bool hasLocalLinkage(mlir::Operation *op) const
bool isCompilerGenerated(mlir::Operation *op) const
bool isDeviceAccessible(mlir::Operation *op) const
mlir::Region * getInitRegion(mlir::Operation *op) const
bool isConstant(mlir::Operation *op) const