[PATCH] D109458: [NVPTX] Simplify and generalize constant printer.

Justin Lebar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 8 12:39:25 PDT 2021


jlebar accepted this revision.
jlebar added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp:1762-1764
+    std::array<unsigned char, 16> Buf;
+    size_t NumBytes = (Val.getBitWidth() + 7) / 8;
+    assert(NumBytes <= Buf.size() && "value is too large.");
----------------
Any reason we have this restriction on 16 bytes long?  Like, it'll work for i128 but fail for i256, right?

Could we use InlinedVector instead of a fixed std::array?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109458



More information about the llvm-commits mailing list