diff options
author | Rob Clark <[email protected]> | 2020-01-23 16:45:29 -0800 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-02-01 02:40:22 +0000 |
commit | fb09020ef23cc87c1c3024add572cf0a571e8ddc (patch) | |
tree | 0d988f7b73dfafdb167c726f5602cfd746b5de8f /src/freedreno/ir3 | |
parent | 2ffe44ec0a5dba18e4a88ca7dd1042e823f9685e (diff) |
freedreno/ir3: remove unused tex arg harder
Just killing the SSA link isn't enough. It confuses RA, legalize,
and postsched to see a bogus unused reg.
Signed-off-by: Rob Clark <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3569>
Diffstat (limited to 'src/freedreno/ir3')
-rw-r--r-- | src/freedreno/ir3/ir3.c | 20 | ||||
-rw-r--r-- | src/freedreno/ir3/ir3_cp.c | 7 | ||||
-rw-r--r-- | src/freedreno/ir3/ir3_print.c | 4 |
3 files changed, 12 insertions, 19 deletions
diff --git a/src/freedreno/ir3/ir3.c b/src/freedreno/ir3/ir3.c index b9bcf3b08bd..f8cfc6bb3c0 100644 --- a/src/freedreno/ir3/ir3.c +++ b/src/freedreno/ir3/ir3.c @@ -463,23 +463,15 @@ static int emit_cat5(struct ir3_instruction *instr, void *ptr, instr_cat5_t *cat5 = ptr; iassert((instr->regs_count == 2) || - (instr->regs_count == 3) || (instr->regs_count == 4)); + (instr->regs_count == 3) || + (instr->regs_count == 4)); - switch (instr->opc) { - case OPC_DSX: - case OPC_DSXPP_1: - case OPC_DSY: - case OPC_DSYPP_1: - case OPC_RGETPOS: - case OPC_RGETINFO: - iassert((instr->flags & IR3_INSTR_S2EN) == 0); - src1 = instr->regs[1]; - src2 = instr->regs_count > 2 ? instr->regs[2] : NULL; - break; - default: + if (instr->flags & IR3_INSTR_S2EN) { src1 = instr->regs[2]; src2 = instr->regs_count > 3 ? instr->regs[3] : NULL; - break; + } else { + src1 = instr->regs[1]; + src2 = instr->regs_count > 2 ? instr->regs[2] : NULL; } assume(src1 || !src2); diff --git a/src/freedreno/ir3/ir3_cp.c b/src/freedreno/ir3/ir3_cp.c index e04f1daae6b..28c9f82f3ae 100644 --- a/src/freedreno/ir3/ir3_cp.c +++ b/src/freedreno/ir3/ir3_cp.c @@ -723,7 +723,12 @@ instr_cp(struct ir3_cp_ctx *ctx, struct ir3_instruction *instr) instr->flags &= ~IR3_INSTR_S2EN; instr->cat5.samp = samp->regs[1]->iim_val; instr->cat5.tex = tex->regs[1]->iim_val; - instr->regs[1]->instr = NULL; + + /* shuffle around the regs to remove the first src: */ + instr->regs_count--; + for (unsigned i = 1; i < instr->regs_count; i++) { + instr->regs[i] = instr->regs[i + 1]; + } } } } diff --git a/src/freedreno/ir3/ir3_print.c b/src/freedreno/ir3/ir3_print.c index 244239dd240..381319311a3 100644 --- a/src/freedreno/ir3/ir3_print.c +++ b/src/freedreno/ir3/ir3_print.c @@ -206,10 +206,6 @@ print_instr(struct ir3_instruction *instr, int lvl) for (i = 0; i < instr->regs_count; i++) { struct ir3_register *reg = instr->regs[i]; - /* skip the samp/tex src if it has been lowered to immed: */ - if ((i == 1) && is_tex(instr) && !(instr->flags & IR3_INSTR_S2EN)) - continue; - printf(i ? ", " : ""); print_reg_name(reg); } |