This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Lower RankOp to LLVM for unranked memrefs.
ClosedPublic

Authored by pifon2a on Aug 4 2020, 9:29 PM.

Diff Detail

Event Timeline

pifon2a created this revision.Aug 4 2020, 9:29 PM
Herald added a project: Restricted Project. · View Herald Transcript
pifon2a requested review of this revision.Aug 4 2020, 9:29 PM
herhut accepted this revision.Aug 4 2020, 11:56 PM

Thanks!

mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp
2412

Maybe rephrase into a positive: RankOp should be folded away for ranked operands.

mlir/test/Conversion/StandardToLLVM/convert-to-llvmir.mlir
1301

Maybe return rank to make it used?

This revision is now accepted and ready to land.Aug 4 2020, 11:56 PM
ftynse accepted this revision.Aug 5 2020, 1:21 AM
ftynse added inline comments.
mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp
2412

Can't we just emit a constant instead?

pifon2a updated this revision to Diff 283180.Aug 5 2020, 3:11 AM

Address the comments.

This revision was landed with ongoing or failed builds.Aug 5 2020, 3:14 AM
This revision was automatically updated to reflect the committed changes.
Harbormaster completed remote builds in B67069: Diff 283182.
ftynse added inline comments.Aug 5 2020, 4:33 AM
mlir/test/Conversion/StandardToLLVM/convert-to-llvmir.mlir
1307

Irrelevant to this patch, but shouldn't we use i32 for the rank if bitwidth of index is 32?

pifon2a marked 3 inline comments as done.Aug 5 2020, 6:02 AM
pifon2a added inline comments.
mlir/test/Conversion/StandardToLLVM/convert-to-llvmir.mlir
1301

Does it change anything?

pifon2a marked 2 inline comments as done.Aug 5 2020, 6:31 AM
pifon2a added inline comments.
mlir/test/Conversion/StandardToLLVM/convert-to-llvmir.mlir
1307