src/lima/pp_lir/regalloc.c
//Removes useless moves left over from the coalescing process
Removes useless moves left over from the coalescing process
Removes useless moves left over from the coalescing process
static void remove_dead_moves(lima_pp_lir_prog_t* prog)
{
	unsigned i, j;
	for (i = 0; i < prog->num_blocks; i++)
	{
		lima_pp_lir_block_t* block = prog->blocks[i];
		lima_pp_lir_scheduled_instr_t* instr, *temp;
		pp_lir_block_for_each_instr_safe(block, temp, instr)
		{
			for (j = 0; j < 5; j++)
			{
				if (instr->alu_instrs[j] && is_dead_move(instr->alu_instrs[j]))
				{
					lima_pp_lir_instr_delete(instr->alu_instrs[j]);
					instr->alu_instrs[j] = NULL;
				}
			}
			if (lima_pp_lir_sched_instr_is_empty(instr) &&
				(!block->is_end || block->num_instrs > 1))
				lima_pp_lir_block_remove(instr);
		}
	}
}
static void remove_dead_moves ( lima_pp_lir_prog_t * prog ) { unsigned i , j ; for ( i = 0 ; i < prog -> num_blocks ; i ++ ) { lima_pp_lir_block_t * block = prog -> blocks [ i ] ; lima_pp_lir_scheduled_instr_t * instr , * temp ; pp_lir_block_for_each_instr_safe ( block , temp , instr ) { for ( j = 0 ; j < 5 ; j ++ ) { if ( instr -> alu_instrs [ j ] && is_dead_move ( instr -> alu_instrs [ j ] ) ) { lima_pp_lir_instr_delete ( instr -> alu_instrs [ j ] ) ; instr -> alu_instrs [ j ] = NULL ; } } if ( lima_pp_lir_sched_instr_is_empty ( instr ) && ( ! block -> is_end || block -> num_instrs > 1 ) ) lima_pp_lir_block_remove ( instr ) ; } } }
Removes useless moves left over from the coalescing process
Removes useless moves left over from the coalescing process