inst->remove(block);
progress = true;
}
- } else if (inst->writes_flag()) {
+ } else if (inst->flags_written()) {
flag_mov_found[inst->flag_subreg] = false;
}
}
*/
static bool
-opt_cmod_propagation_local(bblock_t *block)
+opt_cmod_propagation_local(const brw_device_info *devinfo, bblock_t *block)
{
bool progress = false;
int ip = block->end_ip + 1;
*/
if (inst->conditional_mod == BRW_CONDITIONAL_NZ &&
!inst->src[0].negate &&
- scan_inst->writes_flag()) {
+ scan_inst->flags_written()) {
inst->remove(block);
progress = true;
break;
break;
}
- if (scan_inst->writes_flag())
+ if (scan_inst->flags_written())
break;
- read_flag = read_flag || scan_inst->reads_flag();
+ read_flag = read_flag || scan_inst->flags_read(devinfo);
}
}
bool progress = false;
foreach_block_reverse(block, cfg) {
- progress = opt_cmod_propagation_local(block) || progress;
+ progress = opt_cmod_propagation_local(devinfo, block) || progress;
}
if (progress)
/* Kill all AEB entries that write a different value to or read from
* the flag register if we just wrote it.
*/
- if (inst->writes_flag()) {
+ if (inst->flags_written()) {
bool negate; /* dummy */
- if (entry->generator->reads_flag() ||
- (entry->generator->writes_flag() &&
+ if (entry->generator->flags_read(devinfo) ||
+ (entry->generator->flags_written() &&
!instructions_match(inst, entry->generator, &negate))) {
entry->remove();
ralloc_free(entry);
if (!result_live) {
progress = true;
- if (inst->writes_accumulator || inst->writes_flag()) {
+ if (inst->writes_accumulator || inst->flags_written()) {
inst->dst = fs_reg(retype(brw_null_reg(), inst->dst.type));
} else {
inst->opcode = BRW_OPCODE_NOP;
}
}
- if (inst->dst.is_null() && inst->writes_flag()) {
+ if (inst->dst.is_null() && inst->flags_written()) {
if (!(flag_live[0] & inst->flags_written())) {
inst->opcode = BRW_OPCODE_NOP;
progress = true;
inst->opcode != BRW_OPCODE_WHILE) &&
inst->dst.is_null() &&
!inst->has_side_effects() &&
- !inst->writes_flag() &&
+ !inst->flags_written() &&
!inst->writes_accumulator) {
inst->opcode = BRW_OPCODE_NOP;
progress = true;
*/
unsigned flags_written() const;
- bool reads_flag() const
- {
- /* XXX - Will get rid of this hack shortly. */
- const brw_device_info devinfo = {};
- return flags_read(&devinfo);
- }
-
- bool writes_flag() const
- {
- return flags_written();
- }
-
fs_reg dst;
fs_reg *src;