torch-mlir/lib/Dialect/Torch/IR
Ashay Rane ac4d7d10e0
canonicalizer: propagate type information across copy and cast ops (#1030)
Prior to this patch, the canonicalizers for `AtenSizeOp` and
`AtenSizeIntOp` succeeded only if the tensor operand's type information
included the size of the requested dimension(s).  We can extend the set
of optimizable cases by propagating types across operations whose result
type matches the input tensor type.

Specifically, this patch enables the canonicalizers for `AtenSizeOp` and
`AtenSizeIntOp` to see past `tensor_static_info_cast`,
`copy.to_vtensor`, and `copy.to_tensor` ops until it reaches the first
op whose result type contains size information for the requested
dimensions, with a maximum bound of 6 parent lookups to avoid indefinite
compilation times.  All other encountered ops cause the canonicalizer to
give up.
2022-07-12 12:38:37 -07:00
..
CMakeLists.txt Reduce compilation time for TorchOps.cpp.inc 2022-03-21 14:42:26 -07:00
TorchDialect.cpp llvm: bump tag to e1318078 (#781) 2022-04-26 12:27:51 -07:00
TorchOps.cpp canonicalizer: propagate type information across copy and cast ops (#1030) 2022-07-12 12:38:37 -07:00
TorchOpsODSGenerated.cpp Reduce compilation time for TorchOps.cpp.inc 2022-03-21 14:42:26 -07:00
TorchTypes.cpp Add support for ScalarType::QUInt8 2022-06-29 15:33:28 -07:00
UtilsForODSGenerated.cpp llvm: bump tag to e1318078 (#781) 2022-04-26 12:27:51 -07:00
UtilsForODSGenerated.h Reduce compilation time for TorchOps.cpp.inc 2022-03-21 14:42:26 -07:00