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

Nick Lewycky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 16 12:00:45 PDT 2021


nickwasmer added inline comments.


================
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
----------------
nickwasmer wrote:
> spatel wrote:
> > Does it make sense to assert that the type is one of the expected values inside here?
> Yes, I don't see why not. The rule applies to the base class which has a static `isElementTypeCompatible` method we could use. Let me land this first and then I'll try the assert and make sure it works and we can do that in a small separate review.
The assert is there after all, it's in ConstantDataSequential::getImpl.


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