[PATCH] D78076: [mlir] Support big endian in DenseElementsAttr

Haruki Imai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 16 16:43:38 PDT 2020


imaihal marked 2 inline comments as done.
imaihal added inline comments.


================
Comment at: mlir/lib/IR/Attributes.cpp:522
   assert((bitPos % CHAR_BIT) == 0 && "expected bitPos to be 8-bit aligned");
-  std::copy_n(reinterpret_cast<const char *>(value.getRawData()),
-              llvm::divideCeil(bitWidth, CHAR_BIT),
+  const char *cptr = reinterpret_cast<const char *>(value.getRawData());
+  if (llvm::support::endian::system_endianness() ==
----------------
rriddle wrote:
> Can you extract this to a static helper above this function and add comments as to what is going on?
Thanks for the review. I added a static helper and comments. Does this meet your request?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78076





More information about the llvm-commits mailing list