This commit adds canonicalization pattern in linalg.generic op
for static shape inference. If any of the inputs or outputs have
static shape or is casted from a tensor of static shape, then
shapes of all the inputs and outputs can be inferred by using the
affine map of the static shape input/output.
Signed-Off-By: Prateek Gupta <prateek@nod-labs.com>
The startIdx part is confusing to me in the way this is written. There seems to be some handshake between source and operands here. Maybe this could work,
static void populateMap(GenericOp genericOp, ArrayRef<OpOperand *> operands, ValueRange source, llvm::DenseMap<AffineExpr, int64_t> &affineExprToSize) { for (auto it : llvm::zip(operands, source)) { OpOperand *opOperand = std::get<0>(it); Value src = std::get<1>(it); ... } ... }In any case, looking at the uses, do you even need to use source. Looks like operands is all you need.