src/lima/gp_ir/dominance.c
// Finds the closest common parent of block_1 and block_2 in the dominator tree
// Equivalent to intersect() in the paper
Finds the closest common parent of block_1 and block_2 in the dominator tree
Equivalent to intersect() in the paper
Finds the closest common parent of block_1 and block_2 in the dominator tree Equivalent to intersect () in the paper
static lima_gp_ir_block_t* intersect(lima_gp_ir_block_t* block_1,
									 lima_gp_ir_block_t* block_2)
{
	while (block_1 != block_2)
	{
		while (block_1->index > block_2->index)
			block_1 = block_1->imm_dominator;
		while (block_2->index > block_1->index)
			block_2 = block_2->imm_dominator;
	}
	return block_1;
}
static lima_gp_ir_block_t * intersect ( lima_gp_ir_block_t * block_1 , lima_gp_ir_block_t * block_2 ) { while ( block_1 != block_2 ) { while ( block_1 -> index > block_2 -> index ) block_1 = block_1 -> imm_dominator ; while ( block_2 -> index > block_1 -> index ) block_2 = block_2 -> imm_dominator ; } return block_1 ; }
Finds the closest common parent of block_1 and block_2 in the dominator tree
Equivalent to intersect() in the paper
Finds the closest common parent of block_1 and block_2 in the dominator tree Equivalent to intersect () in the paper