15 if (isa<spirv::PointerType>(type)) {
24 if (
auto vectorType = dyn_cast<VectorType>(type)) {
25 assert(vectorType.getElementType().isIntOrFloat());
26 return vectorType.getNumElements() *
27 vectorType.getElementType().getIntOrFloatBitWidth();
29 llvm_unreachable(
"unhandled bit width computation for type");
38 spirv::MemorySemantics memorySemantics);
This is a pure-virtual base class that exposes the asmprinter hooks necessary to implement a custom p...
Operation is the basic unit of execution within MLIR.
Instances of the Type class are uniqued, have an immutable identifier and an optional mutable compone...
bool isIntOrFloat() const
Return true if this is an integer (of any signedness) or a float type.
unsigned getIntOrFloatBitWidth() const
Return the bit width of an integer or a float type, assert failure on other types.
LogicalResult verifyMemorySemantics(Operation *op, spirv::MemorySemantics memorySemantics)
void printVariableDecorations(Operation *op, OpAsmPrinter &printer, SmallVectorImpl< StringRef > &elidedAttrs)
LogicalResult extractValueFromConstOp(Operation *op, int32_t &value)
unsigned getBitWidth(Type type)
Returns the bit width of the type.