diff options
| author | gingerBill <bill@gingerbill.org> | 2022-11-25 23:57:55 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2022-11-25 23:57:55 +0000 |
| commit | d88b052d2d9aa8fa012be314bd29d7ae311fc941 (patch) | |
| tree | 09869f936f3c08d7731006d2c7e28b0be48b556d /src/llvm_backend_expr.cpp | |
| parent | 615eccb6d193e9eb2575cfb28b1366c648296c31 (diff) | |
Naïve optimization of named _split_ multiple return valued when `defer` is never used
This is a naïve optimization but it helps a lot in the general case where callee temporary stack variables
are not allocated to represent the named return values by using that specific memory.
In the future, try to check if a specific named return value is ever used a `defer` within a procedure or not,
or is ever passed to a nested procedure call (e.g. possibly escapes).
Diffstat (limited to 'src/llvm_backend_expr.cpp')
| -rw-r--r-- | src/llvm_backend_expr.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/llvm_backend_expr.cpp b/src/llvm_backend_expr.cpp index 389bfb151..2c1bfecd6 100644 --- a/src/llvm_backend_expr.cpp +++ b/src/llvm_backend_expr.cpp @@ -134,7 +134,7 @@ lbValue lb_emit_unary_arith(lbProcedure *p, TokenKind op, lbValue x, Type *type) Type *elem_type = base_array_type(type); // NOTE(bill): Doesn't need to be zero because it will be initialized in the loops - lbAddr res_addr = lb_add_local(p, type, nullptr, false, 0, true); + lbAddr res_addr = lb_add_local(p, type, nullptr, false, true); lbValue res = lb_addr_get_ptr(p, res_addr); bool inline_array_arith = lb_can_try_to_inline_array_arith(type); |