From ca4595e01abf1d6ff15be6e762f55bb76e29196a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Sch=C3=BCrmann?= Date: Thu, 19 Aug 2021 10:46:09 +0200 Subject: [PATCH] nir/opt_shrink_vectors: update docstring in order to reflect the various recent improvements. Reviewed-by: Emma Anholt Part-of: --- src/compiler/nir/nir_opt_shrink_vectors.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/compiler/nir/nir_opt_shrink_vectors.c b/src/compiler/nir/nir_opt_shrink_vectors.c index 5fdcadf..e61f783 100644 --- a/src/compiler/nir/nir_opt_shrink_vectors.c +++ b/src/compiler/nir/nir_opt_shrink_vectors.c @@ -24,15 +24,19 @@ /** * @file * - * Trims off the unused trailing components of SSA defs. + * Removes unused components of SSA defs. * * Due to various optimization passes (or frontend implementations, * particularly prog_to_nir), we may have instructions generating vectors - * whose components don't get read by any instruction. As it can be tricky - * to eliminate unused low components or channels in the middle of a writemask - * (you might need to increment some offset from a load_uniform, for example), - * it is trivial to just drop the trailing components. For vector ALU only used - * by ALU, this pass eliminates arbitrary channels and reswizzles the uses. + * whose components don't get read by any instruction. + * + * For memory loads, while it can be tricky to eliminate unused low components + * or channels in the middle of a writemask (you might need to increment some + * offset from a load_uniform, for example), it is trivial to just drop the + * trailing components. + * For vector ALU and load_const, only used by other ALU instructions, + * this pass eliminates arbitrary channels as well as duplicate channels, + * and reswizzles the uses. * * This pass is probably only of use to vector backends -- scalar backends * typically get unused def channel trimming by scalarizing and dead code -- 2.7.4