MLIR  19.0.0git
Namespaces | Macros | Functions
Serializer.cpp File Reference
#include "Serializer.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVAttributes.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVDialect.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVEnums.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVTypes.h"
#include "mlir/Support/LogicalResult.h"
#include "mlir/Target/SPIRV/SPIRVBinaryUtils.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/Sequence.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/TypeSwitch.h"
#include "llvm/ADT/bit.h"
#include "llvm/Support/Debug.h"
#include <cstdint>
#include <optional>

Go to the source code of this file.

Namespaces

 mlir
 Include the generated interface declarations.
 
 mlir::spirv
 

Macros

#define DEBUG_TYPE   "spirv-serialization"
 

Functions

static BlockgetStructuredControlFlowOpMergeBlock (Operation *op)
 Returns the merge block if the given op is a structured control flow op. More...
 
static BlockgetPhiIncomingBlock (Block *block)
 Given a predecessor block for a block with arguments, returns the block that should be used as the parent block for SPIR-V OpPhi instructions corresponding to the block arguments. More...
 
void mlir::spirv::encodeInstructionInto (SmallVectorImpl< uint32_t > &binary, spirv::Opcode op, ArrayRef< uint32_t > operands)
 Encodes an SPIR-V instruction with the given opcode and operands into the given binary vector. More...
 
static std::string mlir::spirv::getDecorationName (StringRef attrName)
 
template<>
LogicalResult mlir::spirv::Serializer::processTypeDecoration< spirv::ArrayType > (Location loc, spirv::ArrayType type, uint32_t resultID)
 
template<>
LogicalResult mlir::spirv::Serializer::processTypeDecoration< spirv::RuntimeArrayType > (Location loc, spirv::RuntimeArrayType type, uint32_t resultID)
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "spirv-serialization"

Definition at line 31 of file Serializer.cpp.

Function Documentation

◆ getPhiIncomingBlock()

static Block* getPhiIncomingBlock ( Block block)
static

Given a predecessor block for a block with arguments, returns the block that should be used as the parent block for SPIR-V OpPhi instructions corresponding to the block arguments.

Definition at line 48 of file Serializer.cpp.

References mlir::Block::getParentOp(), and mlir::Block::isEntryBlock().

◆ getStructuredControlFlowOpMergeBlock()

static Block* getStructuredControlFlowOpMergeBlock ( Operation op)
static

Returns the merge block if the given op is a structured control flow op.

Otherwise returns nullptr.

Definition at line 37 of file Serializer.cpp.