This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Linalg] Canonicalize TensorCastOp away when it feeds a LinalgOp.
ClosedPublic

Authored by nicolasvasilache on Oct 2 2020, 4:50 AM.

Details

Summary

This canonicalization is the counterpart of MemRefCastOp -> LinalgOp but on tensors.

This is needed to properly canonicalize post linalg tiling on tensors.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptOct 2 2020, 4:50 AM
nicolasvasilache requested review of this revision.Oct 2 2020, 4:50 AM
Harbormaster completed remote builds in B73772: Diff 295795.
pifon2a accepted this revision.Oct 3 2020, 4:23 AM

awesome!

mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOpsInterface.td
650–654

I usually try to avoid having (void) for asserts when it's possible:

auto operand = getOperation()->getOperand(numShapedOperands + i);
assert((operand.getType().isSignlessIntOrIndexOrFloat() 
            || operand.getType().isa<VectorType>()) 
            && "expected scalar or vector type");
res.push_back(operand);
This revision is now accepted and ready to land.Oct 3 2020, 4:23 AM

Drop unused variable.

This revision was landed with ongoing or failed builds.Oct 5 2020, 7:50 AM
This revision was automatically updated to reflect the committed changes.