Add option when collecting uses to control whether they include
falsedeps or not.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4440>
-ir3_find_ssa_uses(struct ir3 *ir, void *mem_ctx)
+ir3_find_ssa_uses(struct ir3 *ir, void *mem_ctx, bool falsedeps)
{
/* We could do this in a single pass if we can assume instructions
* are always sorted. Which currently might not always be true.
{
/* We could do this in a single pass if we can assume instructions
* are always sorted. Which currently might not always be true.
foreach_instr (instr, &block->instr_list) {
struct ir3_instruction *src;
foreach_instr (instr, &block->instr_list) {
struct ir3_instruction *src;
- foreach_ssa_src (src, instr) {
+ foreach_ssa_src_n (src, n, instr) {
+ if (__is_false_dep(instr, n) && !falsedeps)
+ continue;
if (!src->uses)
src->uses = _mesa_pointer_set_create(mem_ctx);
_mesa_set_add(src->uses, instr);
if (!src->uses)
src->uses = _mesa_pointer_set_create(mem_ctx);
_mesa_set_add(src->uses, instr);
unsigned ir3_count_instructions(struct ir3 *ir);
unsigned ir3_count_instructions(struct ir3 *ir);
-void ir3_find_ssa_uses(struct ir3 *ir, void *mem_ctx);
+void ir3_find_ssa_uses(struct ir3 *ir, void *mem_ctx, bool falsedeps);
#include "util/set.h"
#define foreach_ssa_use(__use, __instr) \
#include "util/set.h"
#define foreach_ssa_use(__use, __instr) \
{
void *mem_ctx = ralloc_context(NULL);
{
void *mem_ctx = ralloc_context(NULL);
- ir3_find_ssa_uses(ir, mem_ctx);
+ ir3_find_ssa_uses(ir, mem_ctx, false);
foreach_block (block, &ir->block_list) {
foreach_instr_safe (instr, &block->instr_list) {
foreach_block (block, &ir->block_list) {
foreach_instr_safe (instr, &block->instr_list) {