MLIR  20.0.0git
Classes | Typedefs | Functions
SPIRVCanonicalization.cpp File Reference
#include <optional>
#include <utility>
#include "mlir/Dialect/SPIRV/IR/SPIRVOps.h"
#include "mlir/Dialect/CommonFolders.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVDialect.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVTypes.h"
#include "mlir/Dialect/UB/IR/UBOps.h"
#include "mlir/IR/Matchers.h"
#include "mlir/IR/PatternMatch.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVectorExtras.h"
#include "SPIRVCanonicalization.inc"

Go to the source code of this file.

Classes

struct  IAddCarryFold
 
struct  MulExtendedFold< MulOp, IsSigned >
 
struct  UMulExtendedOpXOne
 
struct  UModSimplification
 

Typedefs

using SMulExtendedOpFold = MulExtendedFold< spirv::SMulExtendedOp, true >
 
using UMulExtendedOpFold = MulExtendedFold< spirv::UMulExtendedOp, false >
 

Functions

static std::optional< bool > getScalarOrSplatBoolAttr (Attribute attr)
 Returns the boolean value under the hood if the given boolAttr is a scalar or splat vector bool constant. More...
 
static Attribute extractCompositeElement (Attribute composite, ArrayRef< unsigned > indices)
 
static bool isDivZeroOrOverflow (const APInt &a, const APInt &b)
 

Typedef Documentation

◆ SMulExtendedOpFold

using SMulExtendedOpFold = MulExtendedFold<spirv::SMulExtendedOp, true>

Definition at line 281 of file SPIRVCanonicalization.cpp.

◆ UMulExtendedOpFold

using UMulExtendedOpFold = MulExtendedFold<spirv::UMulExtendedOp, false>

Definition at line 310 of file SPIRVCanonicalization.cpp.

Function Documentation

◆ extractCompositeElement()

static Attribute extractCompositeElement ( Attribute  composite,
ArrayRef< unsigned >  indices 
)
static

Definition at line 49 of file SPIRVCanonicalization.cpp.

◆ getScalarOrSplatBoolAttr()

static std::optional<bool> getScalarOrSplatBoolAttr ( Attribute  attr)
static

Returns the boolean value under the hood if the given boolAttr is a scalar or splat vector bool constant.

Definition at line 35 of file SPIRVCanonicalization.cpp.

◆ isDivZeroOrOverflow()

static bool isDivZeroOrOverflow ( const APInt &  a,
const APInt &  b 
)
static

Definition at line 72 of file SPIRVCanonicalization.cpp.