[PATCH] D98302: Add ConstantDataVector::getRaw() to create a constant data vector from raw data.

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 16 08:43:13 PDT 2021


spatel accepted this revision.
spatel added a comment.
This revision is now accepted and ready to land.

LGTM - I'm not sure about the intended usage for these APIs, but this looks like a straightforward extension of the existing functionality. See inline for a couple of minor points.



================
Comment at: llvm/include/llvm/IR/Constants.h:561
 /// ConstantDataSequential - A vector or array constant whose element type is a
-/// simple 1/2/4/8-byte integer or float/double, and whose elements are just
-/// simple data values (i.e. ConstantInt/ConstantFP).  This Constant node has no
-/// operands because it stores all of the elements of the constant as densely
-/// packed data, instead of as Value*'s.
+/// simple 1/2/4/8-byte integer or half/bloat/float/double, and whose elements
+/// are just simple data values (i.e. ConstantInt/ConstantFP).  This Constant
----------------
bloat -> bfloat


================
Comment at: llvm/include/llvm/IR/Constants.h:706
   /// passed in. Note that this can return a ConstantAggregateZero object.
-  /// ElementTy needs to be one of i8/i16/i32/i64/float/double. Data is the
-  /// buffer containing the elements. Be careful to make sure Data uses the
+  /// ElementTy must be one of i8/i16/i32/i64/half/bfloat/float/double. Data is
+  /// the buffer containing the elements. Be careful to make sure Data uses the
----------------
Does it make sense to assert that the type is one of the expected values inside here?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98302



More information about the llvm-commits mailing list