Skip to content

Commit

Permalink
llvm: fix convert() for vector type ctors
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugobros3 committed Jul 5, 2024
1 parent f0520b5 commit 06d83c2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/thorin/be/llvm/llvm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,14 +233,16 @@ llvm::Type* CodeGen::convert(const Type* type) {
return llvm::StructType::get(context(), { union_type, tag_type });
}

case Node_VectorType: {
llvm_type = convert(get_scalar_type(type));
llvm_type = llvm::FixedVectorType::get(llvm_type, vector_length(type));
break;
}

default:
THORIN_UNREACHABLE;
}

if (vector_length(type) == 1)
return types_[type] = llvm_type;

llvm_type = llvm::FixedVectorType::get(llvm_type, vector_length(type));
return types_[type] = llvm_type;
}

Expand Down

0 comments on commit 06d83c2

Please sign in to comment.