MLIR  17.0.0git
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
mlir::sparse_tensor::TensorExp Struct Referencefinal

Tensor expression. Represents an MLIR expression in tensor index notation. More...

#include "mlir/Dialect/SparseTensor/Utils/Merger.h"

+ Collaboration diagram for mlir::sparse_tensor::TensorExp:

Classes

struct  Children
 Child subexpressions for non-leaf expressions. More...
 

Public Types

enum class  Kind {
  kTensor = 0 , kInvariant , kLoopVar , kAbsF ,
  kAbsC , kAbsI , kCeilF , kFloorF ,
  kSqrtF , kSqrtC , kExpm1F , kExpm1C ,
  kLog1pF , kLog1pC , kSinF , kSinC ,
  kTanhF , kTanhC , kNegF , kNegC ,
  kNegI , kTruncF , kExtF , kCastFS ,
  kCastFU , kCastSF , kCastUF , kCastS ,
  kCastU , kCastIdx , kTruncI , kCIm ,
  kCRe , kBitCast , kBinaryBranch , kUnary ,
  kSelect , kMulF , kMulC , kMulI ,
  kDivF , kDivC , kDivS , kDivU ,
  kAddF , kAddC , kAddI , kSubF ,
  kSubC , kSubI , kAndI , kOrI ,
  kXorI , kShrS , kShrU , kShlI ,
  kBinary , kReduce
}
 Tensor expression kind. More...
 

Public Member Functions

 TensorExp (Kind k, unsigned x, ExprId y, Value v, Operation *op)
 

Public Attributes

Kind kind
 Tensor expression kind. More...
 
union {
   TensorId   tensor
 kTensor expressions simply have a tensor identifier. More...
 
   LoopId   loop
 kLoopVar expressions simply have a loop identifier. More...
 
   Children   children
 All other expressions hold the ExprIds of their children. More...
 
}; 
 
Value val
 Direct link to IR for an invariant or the destination value (to infer destination type) of a cast operation During code generation, this field may be used to cache "hoisted" loop invariant tensor loads. More...
 
Operationop
 Code blocks used by semirings. More...
 

Detailed Description

Tensor expression. Represents an MLIR expression in tensor index notation.

Definition at line 86 of file Merger.h.

Member Enumeration Documentation

◆ Kind

Tensor expression kind.

The kLoopVar leaf kind is for representing linalg::IndexOp. That is, its argument is a LoopId identifying the loop-variable in question, and its value will be the current iteration's value of that loop-variable. See the LoopId documentation for more details.

Enumerator
kTensor 
kInvariant 
kLoopVar 
kAbsF 
kAbsC 
kAbsI 
kCeilF 
kFloorF 
kSqrtF 
kSqrtC 
kExpm1F 
kExpm1C 
kLog1pF 
kLog1pC 
kSinF 
kSinC 
kTanhF 
kTanhC 
kNegF 
kNegC 
kNegI 
kTruncF 
kExtF 
kCastFS 
kCastFU 
kCastSF 
kCastUF 
kCastS 
kCastU 
kCastIdx 
kTruncI 
kCIm 
kCRe 
kBitCast 
kBinaryBranch 
kUnary 
kSelect 
kMulF 
kMulC 
kMulI 
kDivF 
kDivC 
kDivS 
kDivU 
kAddF 
kAddC 
kAddI 
kSubF 
kSubC 
kSubI 
kAndI 
kOrI 
kXorI 
kShrS 
kShrU 
kShlI 
kBinary 
kReduce 

Definition at line 146 of file Merger.h.

Constructor & Destructor Documentation

◆ TensorExp()

mlir::sparse_tensor::TensorExp::TensorExp ( Kind  k,
unsigned  x,
ExprId  y,
Value  v,
Operation op 
)

Member Data Documentation

◆ 

union { ... }

◆ children

Children mlir::sparse_tensor::TensorExp::children

All other expressions hold the ExprIds of their children.

Definition at line 118 of file Merger.h.

Referenced by genExp(), genInvariants(), and TensorExp().

◆ kind

Kind mlir::sparse_tensor::TensorExp::kind

Tensor expression kind.

Definition at line 108 of file Merger.h.

Referenced by genExp(), genInvariants(), genTensorStore(), and TensorExp().

◆ loop

LoopId mlir::sparse_tensor::TensorExp::loop

kLoopVar expressions simply have a loop identifier.

Definition at line 115 of file Merger.h.

Referenced by genExp(), and TensorExp().

◆ op

Operation* mlir::sparse_tensor::TensorExp::op

Code blocks used by semirings.

For the case of kUnary, kBinary, kReduce, and kSelect, this holds the original operation with all regions. For kBinaryBranch, this holds the YieldOp for the left or right half to be merged into a nested scf loop.

Definition at line 130 of file Merger.h.

◆ tensor

TensorId mlir::sparse_tensor::TensorExp::tensor

kTensor expressions simply have a tensor identifier.

Definition at line 112 of file Merger.h.

Referenced by genInvariants(), genTensorLoad(), and TensorExp().

◆ val

Value mlir::sparse_tensor::TensorExp::val

Direct link to IR for an invariant or the destination value (to infer destination type) of a cast operation During code generation, this field may be used to cache "hoisted" loop invariant tensor loads.

Definition at line 124 of file Merger.h.

Referenced by genInvariantValue(), genTensorLoad(), and genTensorStore().


The documentation for this struct was generated from the following files: