diff options
author | Rob Clark <[email protected]> | 2020-01-23 10:26:27 -0800 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-02-01 02:40:22 +0000 |
commit | 3369406e44b0226295e7475e189da2e42efd7f22 (patch) | |
tree | e8237db77e19243b28a910de9aadb36f76cecd77 | |
parent | 9a9f78f1f9f0019687eb374aae5abcd3b0617cf4 (diff) |
freedreno/ir3: fix kill scheduling
kill (and other cat0/flow instructions) do not have a dst register.
Which was mostly harmless before, other than RA thinking it would need
a free register to write. (But nothing consumed it, so the value would
be immediately dead.) But this would cause more problems with postsched
which would see a bogus dependency.
Also, post-RA sched *does* need to see the dependency on the predicate
register.
Signed-off-by: Rob Clark <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3569>
-rw-r--r-- | src/freedreno/ir3/ir3.h | 2 | ||||
-rw-r--r-- | src/freedreno/ir3/ir3_compiler_nir.c | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/src/freedreno/ir3/ir3.h b/src/freedreno/ir3/ir3.h index b9cf06e636d..b10f2f0da79 100644 --- a/src/freedreno/ir3/ir3.h +++ b/src/freedreno/ir3/ir3.h @@ -794,7 +794,7 @@ static inline bool is_meta(struct ir3_instruction *instr) static inline unsigned dest_regs(struct ir3_instruction *instr) { - if ((instr->regs_count == 0) || is_store(instr)) + if ((instr->regs_count == 0) || is_store(instr) || is_flow(instr)) return 0; return util_last_bit(instr->regs[0]->wrmask); diff --git a/src/freedreno/ir3/ir3_compiler_nir.c b/src/freedreno/ir3/ir3_compiler_nir.c index c5a1f915b9c..13052648814 100644 --- a/src/freedreno/ir3/ir3_compiler_nir.c +++ b/src/freedreno/ir3/ir3_compiler_nir.c @@ -1780,6 +1780,7 @@ emit_intrinsic(struct ir3_context *ctx, nir_intrinsic_instr *intr) cond->regs[0]->flags &= ~IR3_REG_SSA; kill = ir3_KILL(b, cond, 0); + kill->regs[1]->num = regid(REG_P0, 0); array_insert(ctx->ir, ctx->ir->predicates, kill); array_insert(b, b->keeps, kill); |