[clang] [CIR] Upstream initial support for fixed size VectorType (PR #136488)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 21 06:21:42 PDT 2025


================
@@ -654,6 +654,25 @@ cir::VectorType::getABIAlignment(const ::mlir::DataLayout &dataLayout,
   return llvm::NextPowerOf2(dataLayout.getTypeSizeInBits(*this));
 }
 
+mlir::LogicalResult cir::VectorType::verify(
+    llvm::function_ref<mlir::InFlightDiagnostic()> emitError,
+    mlir::Type eltType, uint64_t size) {
+  if (size == 0)
+    return emitError() << "the number of vector elements must be positive";
+
+  // Check if it a valid FixedVectorType
+  if (mlir::isa<cir::PointerType, cir::FP128Type>(eltType))
+    return success();
+
+  // Check if it a valid VectorType
+  if (mlir::isa<cir::IntType>(eltType) || isAnyFloatingPointType(eltType))
+    return success();
+
+  eltType.dump();
----------------
erichkeane wrote:

Is this supposed to be here?

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


More information about the cfe-commits mailing list