diff --git a/src/CodeGen_LLVM.cpp b/src/CodeGen_LLVM.cpp index 9721a1c2ad80..ff1bd682aca0 100644 --- a/src/CodeGen_LLVM.cpp +++ b/src/CodeGen_LLVM.cpp @@ -4528,7 +4528,9 @@ Value *CodeGen_LLVM::call_intrin(const llvm::Type *result_type, int intrin_lanes llvm::Function *intrin, vector arg_values) { internal_assert(intrin); int arg_lanes = 1; - if (result_type->isVectorTy()) { + if (result_type->isVoidTy()) { + arg_lanes = intrin_lanes; + } else if (result_type->isVectorTy()) { arg_lanes = get_vector_num_elements(result_type); } @@ -4913,6 +4915,10 @@ llvm::Type *CodeGen_LLVM::get_vector_type(llvm::Type *t, int n, VectorTypeConstraint type_constraint) const { bool scalable; + if (t->isVoidTy()) { + return t; + } + switch (type_constraint) { case VectorTypeConstraint::None: scalable = effective_vscale != 0 &&