mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 03:08:05 +02:00
i965/fs: Clean up remaining uses of fs_inst::reads_flag and ::writes_flag.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
parent
ecd7a7255a
commit
7d430fc05e
5 changed files with 12 additions and 24 deletions
|
|
@ -5640,7 +5640,7 @@ fs_visitor::opt_drop_redundant_mov_to_flags()
|
|||
inst->remove(block);
|
||||
progress = true;
|
||||
}
|
||||
} else if (inst->writes_flag()) {
|
||||
} else if (inst->flags_written()) {
|
||||
flag_mov_found[inst->flag_subreg] = false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
*/
|
||||
|
||||
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;
|
||||
|
|
@ -123,7 +123,7 @@ opt_cmod_propagation_local(bblock_t *block)
|
|||
*/
|
||||
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;
|
||||
|
|
@ -144,10 +144,10 @@ opt_cmod_propagation_local(bblock_t *block)
|
|||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -160,7 +160,7 @@ fs_visitor::opt_cmod_propagation()
|
|||
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)
|
||||
|
|
|
|||
|
|
@ -303,10 +303,10 @@ fs_visitor::opt_cse_local(bblock_t *block)
|
|||
/* 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);
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ fs_visitor::dead_code_eliminate()
|
|||
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;
|
||||
|
|
@ -76,7 +76,7 @@ fs_visitor::dead_code_eliminate()
|
|||
}
|
||||
}
|
||||
|
||||
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;
|
||||
|
|
@ -87,7 +87,7 @@ fs_visitor::dead_code_eliminate()
|
|||
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;
|
||||
|
|
|
|||
|
|
@ -288,18 +288,6 @@ public:
|
|||
*/
|
||||
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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue