Skip to content

Commit 06d83c2

Browse files
committed
llvm: fix convert() for vector type ctors
1 parent f0520b5 commit 06d83c2

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/thorin/be/llvm/llvm.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,14 +233,16 @@ llvm::Type* CodeGen::convert(const Type* type) {
233233
return llvm::StructType::get(context(), { union_type, tag_type });
234234
}
235235

236+
case Node_VectorType: {
237+
llvm_type = convert(get_scalar_type(type));
238+
llvm_type = llvm::FixedVectorType::get(llvm_type, vector_length(type));
239+
break;
240+
}
241+
236242
default:
237243
THORIN_UNREACHABLE;
238244
}
239245

240-
if (vector_length(type) == 1)
241-
return types_[type] = llvm_type;
242-
243-
llvm_type = llvm::FixedVectorType::get(llvm_type, vector_length(type));
244246
return types_[type] = llvm_type;
245247
}
246248

0 commit comments

Comments
 (0)