aboutsummaryrefslogtreecommitdiff
path: root/src/codegen
diff options
context:
space:
mode:
authorVeikka Tuominen <git@vexu.eu>2024-01-29 13:48:35 +0200
committerVeikka Tuominen <git@vexu.eu>2024-01-29 13:51:57 +0200
commit78e982f7c3e8a441259d26a69690d8934dd32bf0 (patch)
tree75bd93c8a6fe90688da32e90c27683f93a9e55d0 /src/codegen
parent281b2695c480de1d50e1a0c03c5f5dde36010501 (diff)
downloadzig-78e982f7c3e8a441259d26a69690d8934dd32bf0.tar.gz
zig-78e982f7c3e8a441259d26a69690d8934dd32bf0.zip
llvm: fix alignment of array ptr when bitcasting vector
Closes #17996
Diffstat (limited to 'src/codegen')
-rw-r--r--src/codegen/llvm.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig
index 10323b688c..ef357706e8 100644
--- a/src/codegen/llvm.zig
+++ b/src/codegen/llvm.zig
@@ -8722,10 +8722,10 @@ pub const FuncGen = struct {
if (!result_is_ref) {
return self.dg.todo("implement bitcast vector to non-ref array", .{});
}
- const array_ptr = try self.buildAllocaWorkaround(inst_ty, .default);
+ const alignment = inst_ty.abiAlignment(mod).toLlvm();
+ const array_ptr = try self.buildAllocaWorkaround(inst_ty, alignment);
const bitcast_ok = elem_ty.bitSize(mod) == elem_ty.abiSize(mod) * 8;
if (bitcast_ok) {
- const alignment = inst_ty.abiAlignment(mod).toLlvm();
_ = try self.wip.store(.normal, operand, array_ptr, alignment);
} else {
// If the ABI size of the element type is not evenly divisible by size in bits;