This is an archive of the discontinued LLVM Phabricator instance.

[mlir] support !shape.value_shape when replace WithOp in OutlineShapeComputationPass.
ClosedPublic

Authored by python3kgae on Jan 20 2023, 10:52 PM.

Details

Summary

For https://github.com/llvm/llvm-project/issues/60069

In case like:

%1 = shape.with_shape %arg1, %0 : !shape.value_shape, !shape.shape
%2 = shape.value_of %1 : tensor<?xf32>

cannot replace %2 with %arg1.
Transform it into

%2 = shape.value_of %arg1 : tensor<?xf32>

Diff Detail

Event Timeline

python3kgae created this revision.Jan 20 2023, 10:52 PM
python3kgae requested review of this revision.Jan 20 2023, 10:52 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 20 2023, 10:52 PM
jpienaar added inline comments.Jan 21 2023, 4:44 AM
mlir/lib/Dialect/Shape/Transforms/OutlineShapeComputation.cpp
237

Could you add a comment here to explain?

add comments about the transform.

python3kgae marked an inline comment as done.Jan 21 2023, 7:02 AM
python3kgae added inline comments.
mlir/lib/Dialect/Shape/Transforms/OutlineShapeComputation.cpp
237

Done.

jpienaar accepted this revision.Jan 23 2023, 7:04 PM

Looks good, as Mehdi mentioned using Fixes #60069 will result in closing the issue upon commit.

mlir/test/Dialect/Shape/arg_with_shape.mlir
11

Nit: lets use something like @repro_issue_60069 or some such to give additional context for future folks.

This revision is now accepted and ready to land.Jan 23 2023, 7:04 PM
python3kgae marked an inline comment as done.

Fix clang-format missed by arc lint