[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


================
@@ -98,6 +99,13 @@ class ConstantInt final : public ConstantData {
   /// value. Otherwise return a ConstantInt for the given value.
   static Constant *get(Type *Ty, uint64_t V, bool IsSigned = false);
 
+  /// WARNING: Incomplete support, do not use. These methods exist for early
+  /// prototyping, for most use cases ConstantInt::get() should be used.
+  /// Return a ConstantInt with a splat of the given value.
+  static ConstantInt *getSplat(LLVMContext &Context, ElementCount EC,
+                               const APInt &V);
+  static ConstantInt *getSplat(const VectorType *Ty, const APInt &V);
----------------
paulwalker-arm wrote:

OK, thanks.  It seems I've incorrectly assumed from an IR parsing and printing point of view there is a requirement for `IR_out == IR_in`. Your suggestion certainly means I can break the work up some more so I get that sorted.

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


More information about the cfe-commits mailing list