MLIR 22.0.0git
LowerVectorShapeCast.cpp File Reference

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "vector-shape-cast-lowering"

Functions

static void inplaceAdd (int64_t lhs, ArrayRef< int64_t > base, MutableArrayRef< int64_t > rhs)
 Perform the inplace update rhs <- lhs + rhs.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "vector-shape-cast-lowering"

Definition at line 27 of file LowerVectorShapeCast.cpp.

Function Documentation

◆ inplaceAdd()

void inplaceAdd ( int64_t lhs,
ArrayRef< int64_t > base,
MutableArrayRef< int64_t > rhs )
static

Perform the inplace update rhs <- lhs + rhs.

where rhs is a number expressed in mixed base base with most signficant dimensions on the left. For example if rhs is {a,b,c} and base is {5,3,2} then rhs has value a*3*2 + b*2 + c.

Some examples where base is {5,3,2}: rhs = {0,0,0}, lhs = 1 --> rhs = {0,0,1} rhs = {0,0,1}, lhs = 1 --> rhs = {0,1,0} rhs = {0,0,0}, lhs = 25 --> rhs = {4,0,1}

Invalid: rhs = {0,0,2}, lhs = 1 : rhs not in base {5,3,2}

Overflows not handled correctly: rhs = {4,2,1}, lhs = 2 --> rhs = {0,0,0} (not {0,0,1})

Definition at line 48 of file LowerVectorShapeCast.cpp.

References lhs, and rhs.