diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2026-01-30 10:49:55 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-30 10:49:55 +0000 |
| commit | 19b545e7cb0b09a7c8b3424ca8276b9e37f8de80 (patch) | |
| tree | 974b844bf082c526f6a12396c4a80adfc73b9a60 /src/llvm_backend_opt.cpp | |
| parent | 8b745c3909a3482aebe27998d8b870286e448e35 (diff) | |
| parent | 5a21213fa5e2c74d5021adb2a87f0cc441a38eab (diff) | |
Merge branch 'master' into bill/feature-using-stmt
Diffstat (limited to 'src/llvm_backend_opt.cpp')
| -rw-r--r-- | src/llvm_backend_opt.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/llvm_backend_opt.cpp b/src/llvm_backend_opt.cpp index 4971b1f10..4131f32bf 100644 --- a/src/llvm_backend_opt.cpp +++ b/src/llvm_backend_opt.cpp @@ -309,7 +309,15 @@ gb_internal void lb_run_remove_dead_instruction_pass(lbProcedure *p) { // NOTE(bill): Explicit instructions are set here because some instructions could have side effects switch (LLVMGetInstructionOpcode(curr_instr)) { - // case LLVMAlloca: + case LLVMAlloca: + if (map_get(&p->tuple_fix_map, curr_instr) != nullptr) { + // NOTE(bill, 2025-12-27): Remove temporary tuple fix alloca instructions + // if they are never used + removal_count += 1; + LLVMInstructionEraseFromParent(curr_instr); + was_dead_instructions = true; + } + break; case LLVMLoad: if (LLVMGetVolatile(curr_instr)) { break; |