mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 10:20:09 +01:00
pan/bi: Assume SSA in CSE
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17794>
This commit is contained in:
parent
0e456da750
commit
efee0ddd91
1 changed files with 1 additions and 19 deletions
|
|
@ -47,7 +47,6 @@ hash_index(uint32_t hash, bi_index index)
|
|||
hash = HASH(hash, index.neg);
|
||||
hash = HASH(hash, index.swizzle);
|
||||
hash = HASH(hash, index.offset);
|
||||
hash = HASH(hash, index.reg);
|
||||
hash = HASH(hash, index.type);
|
||||
return hash;
|
||||
}
|
||||
|
|
@ -140,22 +139,6 @@ instr_can_cse(const bi_instr *I)
|
|||
if (I->branch_target)
|
||||
return false;
|
||||
|
||||
/* Refuse to CSE non-SSA destinations since the data flow analysis
|
||||
* required is nontrivial */
|
||||
bi_foreach_dest(I, d) {
|
||||
if (!bi_is_null(I->dest[d]) && !bi_is_ssa(I->dest[d]))
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Similar refuse to CSE non-SSA sources. We allow machine registers,
|
||||
* since CSE runs before register allocation which means any registers
|
||||
* encountered are preloaded and hence assumed constant.
|
||||
*/
|
||||
bi_foreach_src(I, s) {
|
||||
if (I->src[s].reg)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -193,8 +176,7 @@ bi_opt_cse(bi_context *ctx)
|
|||
const bi_instr *match = entry->key;
|
||||
|
||||
bi_foreach_dest(instr, d) {
|
||||
if (!bi_is_null(instr->dest[d]))
|
||||
replacement[instr->dest[d].value] = match->dest[d];
|
||||
replacement[instr->dest[d].value] = match->dest[d];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue