Mesa (master): pan/mdg: Ensure we don't DCE into impossible masks

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri May 22 18:20:49 UTC 2020


Module: Mesa
Branch: master
Commit: d8c16200e9730e4f4f56dc1478dc72dccce26203
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d8c16200e9730e4f4f56dc1478dc72dccce26203

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Thu May 21 17:51:06 2020 -0400

pan/mdg: Ensure we don't DCE into impossible masks

We round up for ld/st.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5153>

---

 src/panfrost/midgard/midgard_opt_dce.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/panfrost/midgard/midgard_opt_dce.c b/src/panfrost/midgard/midgard_opt_dce.c
index be9307e712a..93d3d45b241 100644
--- a/src/panfrost/midgard/midgard_opt_dce.c
+++ b/src/panfrost/midgard/midgard_opt_dce.c
@@ -73,9 +73,14 @@ midgard_opt_dead_code_eliminate_block(compiler_context *ctx, midgard_block *bloc
         mir_foreach_instr_in_block_rev(block, ins) {
                 if (can_cull_mask(ctx, ins)) {
                         unsigned type_size = nir_alu_type_get_type_size(ins->dest_type);
+                        unsigned round_size = type_size;
                         unsigned oldmask = ins->mask;
 
-                        unsigned rounded = mir_round_bytemask_up(live[ins->dest], type_size);
+                        /* Make sure we're packable */
+                        if (type_size == 16 && ins->type == TAG_LOAD_STORE_4)
+                                round_size = 32;
+
+                        unsigned rounded = mir_round_bytemask_up(live[ins->dest], round_size);
                         unsigned cmask = mir_from_bytemask(rounded, type_size);
 
                         ins->mask &= cmask;



More information about the mesa-commit mailing list