[llvm] [clang] [LLVM][IR] Add native vector support to ConstantInt & ConstantFP. (PR #74502)

Paul Walker via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 5 12:48:30 PST 2023


================
@@ -136,7 +144,11 @@ class ConstantInt final : public ConstantData {
   inline const APInt &getValue() const { return Val; }
 
   /// getBitWidth - Return the bitwidth of this constant.
-  unsigned getBitWidth() const { return Val.getBitWidth(); }
+  unsigned getBitWidth() const {
+    assert(getType()->isIntegerTy() &&
+           "Returning the bitwidth of a vector constant is not support!");
----------------
paulwalker-arm wrote:

Fair enough.

https://github.com/llvm/llvm-project/pull/74502


More information about the cfe-commits mailing list