Page MenuHomePhabricator

[MLIR] Fix standard -> LLVM conversion to fail for unsupported memref element type.
ClosedPublic

Authored by jurahul on Nov 12 2020, 11:50 AM.

Details

Summary
  • Move isSupportedMemRefType() to ConvertToLLVMPatterns and check if the memref element type is supported there.

Diff Detail

Event Timeline

jurahul created this revision.Nov 12 2020, 11:50 AM
jurahul requested review of this revision.Nov 12 2020, 11:50 AM

This addresses the nit in https://reviews.llvm.org/D90803 more generically.

jurahul added inline comments.Nov 12 2020, 12:05 PM
mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp
2438

This is a leftover. Will remove it.

jurahul updated this revision to Diff 304930.Nov 12 2020, 12:05 PM

Remove leftover check.

Would a test case be applicable here? I assume this leads to a pattern match failure and the op staying as is in a simple case.

AFAICT it's not possible today to hit this, so this turns out to be just defensive programming. MemRef element type is either int/float/index/complex or a vector (which itself can only have int or float elements) and all these types seems to be convertible to LLVM types without any failures. As such, I don't think we will run into this issue today, but will guard against future extensions to MemRef types.

ftynse accepted this revision.Nov 12 2020, 3:19 PM
This revision is now accepted and ready to land.Nov 12 2020, 3:19 PM