This is an archive of the discontinued LLVM Phabricator instance.

Mark TensorDialect legal and PadTensor op illegal
ClosedPublic

Authored by cathyzhyi on Jul 8 2021, 10:39 AM.

Details

Summary

GeneralizePadTensorOpPattern might generate tensor.dim op so the
TensorDialect should be marked legal. This pattern should also
transform all linalg.pad_tensor ops so mark those as illegal. Those
changes are missed from a previous change in
https://reviews.llvm.org/D105293

Diff Detail

Event Timeline

cathyzhyi created this revision.Jul 8 2021, 10:39 AM
cathyzhyi requested review of this revision.Jul 8 2021, 10:39 AM

Do you know why previous tests didn't need this? Should we add a new test?

Do you know why previous tests didn't need this? Should we add a new test?

yea, I think it's because the integration test added has static tensor shape so the tensor::Dim ops are not generated. Let me add another test for dynamic shape.

Do you know why previous tests didn't need this? Should we add a new test?

+1: can we get a test?

Also please be more descriptive in the title and provide a contextual description: https://mlir.llvm.org/getting_started/Contributing/#commit-messages

cathyzhyi updated this revision to Diff 357314.Jul 8 2021, 12:12 PM

Add an integration test for dynamic shape case when testing padtensor
lowering. Add comments to be more descriptive.

cathyzhyi edited the summary of this revision. (Show Details)Jul 8 2021, 12:14 PM

I don't think we need an integration test here. A regular IR test would be enough to exercise it? (just snapshot the IR from the itnegration test before linalg-bufferize)

cathyzhyi updated this revision to Diff 357342.Jul 8 2021, 1:39 PM
cathyzhyi edited the summary of this revision. (Show Details)

remove the integration test and add IR unit test instead

silvas accepted this revision.Jul 8 2021, 1:41 PM
This revision is now accepted and ready to land.Jul 8 2021, 1:41 PM
This revision was landed with ongoing or failed builds.Jul 8 2021, 3:02 PM
This revision was automatically updated to reflect the committed changes.