src/lima/pp_lir/regalloc.c
//Add an edge between dst and other
Add an edge between dst and other
Add an edge between dst and other
static void add_move_edge(lima_pp_lir_reg_t* src, lima_pp_lir_reg_t* dst,
						  lima_pp_lir_reg_t* other, unsigned* swizzle,
						  bitset_t detailed_matrix, bitset_t coarse_matrix,
						  unsigned num_regs)
{
	unsigned dst_index = get_index(dst);
	unsigned other_index = get_index(other);
	if (!reg_interferes(coarse_matrix, num_regs, dst, other))
	{
		bitset_set(coarse_matrix, (num_regs + 1)*dst_index + other_index, true);
		bitset_set(coarse_matrix, (num_regs + 1)*other_index + dst_index, true);
		ptr_vector_add(&dst->adjacent, other);
		ptr_vector_add(&other->adjacent, dst);
		if (!dst->precolored)
			dst->q_total += q[get_reg_class(dst)][get_reg_class(other)];
		if (!other->precolored)
			other->q_total += q[get_reg_class(other)][get_reg_class(dst)];
	}
	unsigned i, j;
	for (i = 0; i < src->size; i++)
		for (j = 0; j < dst->size; j++)
			if (component_interferes(detailed_matrix, num_regs, src, other, i, j))
			{
				bitset_set(detailed_matrix,
						   (num_regs + 1)*4*(4*dst_index + swizzle[i])
						   + (4*other_index + j), true);
				bitset_set(detailed_matrix,
						   (num_regs + 1)*4*(4*other_index + j)
						   + (4*dst_index + swizzle[i]), true);
			}
}
static void add_move_edge ( lima_pp_lir_reg_t * src , lima_pp_lir_reg_t * dst , lima_pp_lir_reg_t * other , unsigned * swizzle , bitset_t detailed_matrix , bitset_t coarse_matrix , unsigned num_regs ) { unsigned dst_index = get_index ( dst ) ; unsigned other_index = get_index ( other ) ; if ( ! reg_interferes ( coarse_matrix , num_regs , dst , other ) ) { bitset_set ( coarse_matrix , ( num_regs + 1 ) * dst_index + other_index , true ) ; bitset_set ( coarse_matrix , ( num_regs + 1 ) * other_index + dst_index , true ) ; ptr_vector_add ( & dst -> adjacent , other ) ; ptr_vector_add ( & other -> adjacent , dst ) ; if ( ! dst -> precolored ) dst -> q_total += q [ get_reg_class ( dst ) ] [ get_reg_class ( other ) ] ; if ( ! other -> precolored ) other -> q_total += q [ get_reg_class ( other ) ] [ get_reg_class ( dst ) ] ; } unsigned i , j ; for ( i = 0 ; i < src -> size ; i ++ ) for ( j = 0 ; j < dst -> size ; j ++ ) if ( component_interferes ( detailed_matrix , num_regs , src , other , i , j ) ) { bitset_set ( detailed_matrix , ( num_regs + 1 ) * 4 * ( 4 * dst_index + swizzle [ i ] ) + ( 4 * other_index + j ) , true ) ; bitset_set ( detailed_matrix , ( num_regs + 1 ) * 4 * ( 4 * other_index + j ) + ( 4 * dst_index + swizzle [ i ] ) , true ) ; } }
Add an edge between dst and other
Add an edge between dst and other