From aeacf3a9d8a1f6aa36d5c1315e1d8529bb985847 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Wed, 24 Aug 2022 13:07:41 +0100 Subject: Correct max alignment handling throughout the llvm backend --- src/llvm_backend_expr.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/llvm_backend_expr.cpp') diff --git a/src/llvm_backend_expr.cpp b/src/llvm_backend_expr.cpp index dd66943d7..7d81d1407 100644 --- a/src/llvm_backend_expr.cpp +++ b/src/llvm_backend_expr.cpp @@ -137,7 +137,7 @@ lbValue lb_emit_unary_arith(lbProcedure *p, TokenKind op, lbValue x, Type *type) lbAddr res_addr = lb_add_local(p, type, nullptr, false, 0, true); lbValue res = lb_addr_get_ptr(p, res_addr); - bool inline_array_arith = type_size_of(type) <= build_context.max_align; + bool inline_array_arith = lb_can_try_to_inline_array_arith(type); i32 count = cast(i32)get_array_type_count(tl); @@ -436,7 +436,7 @@ lbValue lb_emit_arith_array(lbProcedure *p, TokenKind op, lbValue lhs, lbValue r return direct_vector_res; } - bool inline_array_arith = type_size_of(type) <= build_context.max_align; + bool inline_array_arith = lb_can_try_to_inline_array_arith(type); if (inline_array_arith) { auto dst_ptrs = slice_make(temporary_allocator(), n); @@ -2303,7 +2303,7 @@ lbValue lb_emit_comp(lbProcedure *p, TokenKind op_kind, lbValue left, lbValue ri cmp_op = Token_And; } - bool inline_array_arith = type_size_of(tl) <= build_context.max_align; + bool inline_array_arith = lb_can_try_to_inline_array_arith(tl); i32 count = 0; switch (tl->kind) { case Type_Array: count = cast(i32)tl->Array.count; break; -- cgit v1.2.3