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_general.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_general.cpp')
| -rw-r--r-- | src/llvm_backend_general.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/llvm_backend_general.cpp b/src/llvm_backend_general.cpp index 9fef5b05e..777755794 100644 --- a/src/llvm_backend_general.cpp +++ b/src/llvm_backend_general.cpp @@ -2868,7 +2868,7 @@ lbValue lb_build_cond(lbProcedure *p, Ast *cond, lbBlock *true_block, lbBlock *f } -lbAddr lb_add_local(lbProcedure *p, Type *type, Entity *e, bool zero_init, i32 param_index, bool force_no_init) { +lbAddr lb_add_local(lbProcedure *p, Type *type, Entity *e, bool zero_init, bool force_no_init) { GB_ASSERT(p->decl_block != p->curr_block); LLVMPositionBuilderAtEnd(p->builder, p->decl_block->block); @@ -2922,7 +2922,7 @@ lbAddr lb_add_local_generated(lbProcedure *p, Type *type, bool zero_init) { } lbAddr lb_add_local_generated_temp(lbProcedure *p, Type *type, i64 min_alignment) { - lbAddr res = lb_add_local(p, type, nullptr, false, 0, true); + lbAddr res = lb_add_local(p, type, nullptr, false, true); lb_try_update_alignment(res.addr, cast(unsigned)min_alignment); return res; } |