MLIR  17.0.0git
Macros | Functions
VectorToSPIRV.cpp File Reference
#include "mlir/Conversion/VectorToSPIRV/VectorToSPIRV.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVDialect.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVOps.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVTypes.h"
#include "mlir/Dialect/SPIRV/Transforms/SPIRVConversion.h"
#include "mlir/Dialect/Vector/IR/VectorOps.h"
#include "mlir/IR/BuiltinAttributes.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/Matchers.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/IR/TypeUtilities.h"
#include "mlir/Support/LogicalResult.h"
#include "mlir/Transforms/DialectConversion.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/FormatVariadic.h"
#include <numeric>
+ Include dependency graph for VectorToSPIRV.cpp:

Go to the source code of this file.

Macros

#define INT_AND_FLOAT_CASE(kind, iop, fop)
 
#define INT_OR_FLOAT_CASE(kind, fop)
 
#define CL_MAX_MIN_OPS
 
#define GL_MAX_MIN_OPS
 

Functions

static uint64_t getFirstIntValue (ArrayAttr attr)
 Gets the first integer value from attr, assuming it is an integer array attribute. More...
 
static int getNumBits (Type type)
 Returns the number of bits for the given scalar/vector type. More...
 

Macro Definition Documentation

◆ CL_MAX_MIN_OPS

#define CL_MAX_MIN_OPS
Value:
spirv::CLFMaxOp, spirv::CLFMinOp, spirv::CLUMaxOp, spirv::CLUMinOp, \
spirv::CLSMaxOp, spirv::CLSMinOp

Definition at line 522 of file VectorToSPIRV.cpp.

◆ GL_MAX_MIN_OPS

#define GL_MAX_MIN_OPS
Value:
spirv::GLFMaxOp, spirv::GLFMinOp, spirv::GLUMaxOp, spirv::GLUMinOp, \
spirv::GLSMaxOp, spirv::GLSMinOp

Definition at line 526 of file VectorToSPIRV.cpp.

◆ INT_AND_FLOAT_CASE

#define INT_AND_FLOAT_CASE (   kind,
  iop,
  fop 
)
Value:
case vector::CombiningKind::kind: \
if (resultType.isa<IntegerType>()) { \
result = rewriter.create<spirv::iop>(loc, resultType, result, next); \
} else { \
assert(resultType.isa<FloatType>()); \
result = rewriter.create<spirv::fop>(loc, resultType, result, next); \
} \
break

◆ INT_OR_FLOAT_CASE

#define INT_OR_FLOAT_CASE (   kind,
  fop 
)
Value:
case vector::CombiningKind::kind: \
result = rewriter.create<fop>(loc, resultType, result, next); \
break

Function Documentation

◆ getFirstIntValue()

static uint64_t getFirstIntValue ( ArrayAttr  attr)
static

Gets the first integer value from attr, assuming it is an integer array attribute.

Definition at line 37 of file VectorToSPIRV.cpp.

◆ getNumBits()

static int getNumBits ( Type  type)
static

Returns the number of bits for the given scalar/vector type.

Definition at line 42 of file VectorToSPIRV.cpp.

References mlir::Type::dyn_cast(), and mlir::Type::getIntOrFloatBitWidth().