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

River Riddle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 13 20:14:52 PDT 2020


rriddle added a comment.

Thanks for the patch!



================
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() ==
----------------
Can you extract this to a static helper above this function and add comments as to what is going on?


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