mirror of
https://github.com/odin-lang/Odin.git
synced 2026-06-11 04:48:10 +00:00
Remove temporary tuple fix alloca instructions if they are never used
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user