offset == inst->offset);
}
-bool
-fs_inst::overwrites_reg(const fs_reg ®) const
-{
- return reg.in_range(dst, DIV_ROUND_UP(size_written, REG_SIZE));
-}
-
bool
fs_inst::is_send_from_grf() const
{
bool read_flag = false;
foreach_inst_in_block_reverse_starting_from(fs_inst, scan_inst, inst) {
- if (scan_inst->overwrites_reg(inst->src[0])) {
+ if (regions_overlap(scan_inst->dst, scan_inst->size_written,
+ inst->src[0], inst->size_read(0))) {
if (scan_inst->is_partial_write() ||
scan_inst->dst.offset != inst->src[0].offset ||
scan_inst->exec_size != inst->exec_size)
/* Mark ACP entries which are killed by this instruction. */
for (int i = 0; i < num_acp; i++) {
- if (inst->overwrites_reg(acp[i]->dst) ||
- inst->overwrites_reg(acp[i]->src)) {
+ if (regions_overlap(inst->dst, inst->size_written,
+ acp[i]->dst, acp[i]->size_written) ||
+ regions_overlap(inst->dst, inst->size_written,
+ acp[i]->src, acp[i]->size_read)) {
BITSET_SET(bd[block->num].kill, i);
}
}
/* Kill all AEB entries that use the destination we just
* overwrote.
*/
- if (inst->overwrites_reg(entry->generator->src[i])) {
+ if (regions_overlap(inst->dst, inst->size_written,
+ entry->generator->src[i],
+ entry->generator->size_read(i))) {
entry->remove();
ralloc_free(entry);
break;
if (scan_ip > end_ip)
return true; /* registers do not interfere */
- if (scan_inst->overwrites_reg(inst->dst) ||
- scan_inst->overwrites_reg(inst->src[0]))
+ if (regions_overlap(scan_inst->dst, scan_inst->size_written,
+ inst->dst, inst->size_written) ||
+ regions_overlap(scan_inst->dst, scan_inst->size_written,
+ inst->src[0], inst->size_read(0)))
return false; /* registers interfere */
}
}
bool interfered = false;
foreach_inst_in_block_reverse_starting_from(fs_inst, scan_inst, inst) {
- if (scan_inst->overwrites_reg(inst->src[0])) {
+ if (regions_overlap(scan_inst->dst, scan_inst->size_written,
+ inst->src[0], inst->size_read(0))) {
if (scan_inst->is_partial_write() ||
(scan_inst->dst.type != inst->dst.type &&
!scan_inst->can_change_types()))
void resize_sources(uint8_t num_sources);
bool equals(fs_inst *inst) const;
- bool overwrites_reg(const fs_reg ®) const;
bool is_send_from_grf() const;
bool is_partial_write() const;
bool is_copy_payload(const brw::simple_allocator &grf_alloc) const;