- Enables inferring return type for ConstShape, takes into account valid return types;
- The compatible return type function could be reused, leaving that for next use refactoring;
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Dialect/Shape/IR/Shape.cpp | ||
---|---|---|
781–782 | I'm thinking if we need to report error here. It seems to me this is to try to infer the return types, any errors may indicate we can't do that, so that is a failed case. What do you think? | |
789–791 | I thinking that do we need to check this or we should have the assumption that it'll be the type we write in ODS? I.e., the size must be 1. Or if we have followed ODS, it's still possible to have size() > 1 case while calling isCompatibleReturnTypes? In the following check if (lhs.isa<ShapeType>() || rhs.isa<ShapeType>()) // Shape type is compatible with all other valid return types. return true; auto lhsTensorType = lhs.cast<TensorType>(); auto rhsTensorType = rhs.cast<TensorType>(); We assume if it's not ShapeType then it will be TensorType, this takes the ODS. | |
804–816 | Can we use verifyCompatibleShapes? |
I'm thinking if we need to report error here. It seems to me this is to try to infer the return types, any errors may indicate we can't do that, so that is a failed case. What do you think?