This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][TOSA] Lower tosa.identity and tosa.identitiyn to linalg
ClosedPublic

Authored by rsuderman on Feb 25 2021, 5:47 PM.

Details

Summary

Both identity ops can be loweried by replacing their results with their
inputs. We keep this as a linalg lowering as other backends may choose to
create copies.

Diff Detail

Event Timeline

rsuderman created this revision.Feb 25 2021, 5:47 PM
rsuderman requested review of this revision.Feb 25 2021, 5:47 PM

Can you add a comment regarding which scenarios identity is load bearing and for which backends?

I was really hoping we could avoid the whole TF mess of "identity is load bearing".

silvas accepted this revision.Feb 26 2021, 2:04 PM
silvas added inline comments.
mlir/test/Conversion/TosaToLinalg/tosa-to-linalg.mlir
259

can you check that the values were actually replaced properly? (probably a separate function is a good place to put them so you can check args/returns).

This revision is now accepted and ready to land.Feb 26 2021, 2:04 PM
rsuderman updated this revision to Diff 326820.Feb 26 2021, 3:21 PM

Added separate test for identitiy and added details for lowering.

rsuderman marked an inline comment as done.Feb 26 2021, 3:46 PM
This revision was landed with ongoing or failed builds.Feb 26 2021, 3:53 PM
This revision was automatically updated to reflect the committed changes.