[Mlir-commits] [mlir] [mlir] Canonicalization pattern for 'shape.shape_of' (PR #98531)
Rafael Ubal
llvmlistbot at llvm.org
Sat Jul 13 08:49:51 PDT 2024
rafaelubalmw wrote:
@sjarus - This was actually great advice, Suraj. In the process of creating the unit test you suggest, I discovered additional simplification opportunities through the introduction of 2 additional folding mechanisms for `tensor.reshape`, which I've added to this PR - see the updated PR description for details. The first detects sequences of `tensor.reshape` ops and forces all consumers to use the original tensor. The second folds away a `tensor.reshape` op with both 1D source and result, even with dynamic shape.
I created a new test file called `unranked-tensor-lowering.mlir` that runs the specific pass sequence `-canonicalize -cse`. A detailed comment in the file provides the necessary context to understand the purpose of that test. My only concern is that this test stresses a combination of rewrite patterns that are not exclusively specific to the `shape` dialect. Maybe it should be moved elsewhere?
https://github.com/llvm/llvm-project/pull/98531
More information about the Mlir-commits
mailing list