mirror of https://github.com/llvm/torch-mlir
d310bb12bd
Currently, the op `torch.tensor_static_info_cast` will not get canonicalized away if the result type has any shape or dtype information. This is because `isValidSubtype` only returns true when the tensor types being compared are exactly the same or the supertype has no shape and dtype information. Being unable to canonicalize away the `torch.tensor_static_info_cast` gets in the way of further optimizations, such as shape propagation. This commit improves `isValidSubtype` by adding logic that compares the shapes and dtypes of the two tensor types to determine of one type is indeed a valid subtype of the other. Fixes https://github.com/llvm/torch-mlir/issues/1926 |
||
---|---|---|
.. | ||
GlobalizeObjectGraph | ||
adjust-calling-conventions.mlir | ||
canonicalize.mlir | ||
decompose-complex-ops-legal.mlir | ||
decompose-complex-ops.mlir | ||
drop-abstract-interp-calculations.mlir | ||
erase-module-initializer.mlir | ||
inline-global-slots-analysis.mlir | ||
inline-global-slots-transform.mlir | ||
invalid.mlir | ||
lower-to-backend-contract-error.mlir | ||
maximize-value-semantics.mlir | ||
ops.mlir | ||
prepare-for-globalize-object-graph.mlir | ||
reduce-op-variants-error.mlir | ||
reduce-op-variants.mlir | ||
refine-public-return.mlir | ||
refine-types-branch.mlir | ||
refine-types-ops.mlir | ||
refine-types.mlir | ||
reify-dtype-calculations.mlir | ||
reify-shape-calculations.mlir | ||
simplify-dtype-calculations.mlir | ||
simplify-shape-calculations.mlir | ||
torch-function-to-torch-backend-pipeline.mlir | ||
verify-backend-contract-error.mlir |