src/lima/gp_ir/scheduler.c
// Merges new into dest, returning false if the two ranges do not overlap
Merges new into dest, returning false if the two ranges do not overlap
Merges new into dest returning false if the two ranges do not overlap
static bool instr_range_union(instr_range_t* dest, instr_range_t new)
{
	bool ret = false;
	if (dest->start_instr <= new.start_instr &&
		new.start_instr <= dest->end_instr)
	{
		dest->start_instr = new.start_instr;
		ret = true;
	}
	if (dest->start_instr <= new.end_instr && new.end_instr <= dest->end_instr)
	{
		dest->end_instr = new.end_instr;
		ret = true;
	}
	if (new.start_instr <= dest->start_instr &&
		dest->start_instr <= new.end_instr)
	{
		ret = true;
	}
	if (new.start_instr <= dest->end_instr && dest->end_instr <= new.end_instr)
	{
		ret = true;
	}
	return ret;
}
static bool instr_range_union ( instr_range_t * dest , instr_range_t new ) { bool ret = false ; if ( dest -> start_instr <= new . start_instr && new . start_instr <= dest -> end_instr ) { dest -> start_instr = new . start_instr ; ret = true ; } if ( dest -> start_instr <= new . end_instr && new . end_instr <= dest -> end_instr ) { dest -> end_instr = new . end_instr ; ret = true ; } if ( new . start_instr <= dest -> start_instr && dest -> start_instr <= new . end_instr ) { ret = true ; } if ( new . start_instr <= dest -> end_instr && dest -> end_instr <= new . end_instr ) { ret = true ; } return ret ; }
Merges new into dest, returning false if the two ranges do not overlap
Merges new into dest returning false if the two ranges do not overlap