[PATCH] D80695: [mlir] Added big endian version of "dense-elements-hex.mlir"

Haruki Imai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 8 21:38:31 PDT 2020


imaihal added a comment.

In D80695#2262458 <https://reviews.llvm.org/D80695#2262458>, @mehdi_amini wrote:

>> If we can assume the hex data is always little-endian, it can be converted here, but we can't assume that.
>
> Why? We control the printer and parser, don't we?

The hex of current `dense-elements-hex.mlir` is LE. So, we can pass the test by controlling the printer and parser.  ( LE to BE in the parser, and BE to LE in the printer)
If we can force users to write LE in the attribute, there is no problem. However, users may write the hex of BE in the attributes. 
In that case, the parser and printer should not convert the hex, but since they don't know whether the hex in the attribute is BE or LE, I think they can not process correctly.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80695/new/

https://reviews.llvm.org/D80695



More information about the llvm-commits mailing list