This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][Tosa] TosaToTensor: create valid reshapes
ClosedPublic

Authored by mgehre-amd on Jul 6 2023, 1:16 PM.

Details

Summary

The pattern would create reshape ops without a newShape attr.
This fails the verifier (which can be seen in the debug output;
but curiously doesn't abort compilation),
and can cause crashes in other code that expect to see valid
reshape ops, like ReshapeOp::fold.

The effects cannot be seen in the the test case of the pass because the results of this pattern
are further transformed by other patterns of this pass.

Diff Detail

Event Timeline

mgehre-amd created this revision.Jul 6 2023, 1:16 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 6 2023, 1:16 PM
mgehre-amd requested review of this revision.Jul 6 2023, 1:16 PM
mgehre-amd edited the summary of this revision. (Show Details)Jul 6 2023, 1:17 PM
eric-k256 accepted this revision.Jul 7 2023, 1:43 PM

Looks good to me. I'm also not sure why the existing version does not fail.

This revision is now accepted and ready to land.Jul 7 2023, 1:43 PM