This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Linalg] Handle null affine map returns from inversePermutation.
ClosedPublic

Authored by mravishankar on Apr 11 2020, 11:00 PM.

Details

Summary

The inversePermutation method returns a null map on failure. Update
uses of this method within Linalg to handle this. In LinalgToLoops the
null return value was used to emit scalar code. Modify that to return
failure, and emit scalar implementation when affine map is "empty",
i.e. 1 dims, 0 symbols and no result exprs.
Also add test case for generating scalar code.

Depends On D77678

Diff Detail

Event Timeline

mravishankar created this revision.Apr 11 2020, 11:00 PM
This revision is now accepted and ready to land.Apr 12 2020, 10:27 AM

Can you clarify the NFC here? Seems like you supply even a test to observe some behavior change?

Drop NFC and add additional checks at all uses of inversePermutation
to handle null return value.

This revision now requires review to proceed.Apr 13 2020, 1:09 PM
mravishankar retitled this revision from [mlir][Linalg] NFC : Fix check for scalar case handling in LinalgToLoops to [mlir][Linalg] Handle null affine map returns from inversePermutation..Apr 13 2020, 1:10 PM
mravishankar edited the summary of this revision. (Show Details)
rriddle accepted this revision.Apr 13 2020, 1:14 PM
This revision is now accepted and ready to land.Apr 13 2020, 1:14 PM
Harbormaster failed remote builds in B53193: Diff 257418!
This revision was automatically updated to reflect the committed changes.