nir/opt_shrink_vectors: update docstring
authorDaniel Schürmann <daniel@schuermann.dev>
Thu, 19 Aug 2021 08:46:09 +0000 (10:46 +0200)
committerMarge Bot <emma+marge@anholt.net>
Fri, 4 Mar 2022 00:18:58 +0000 (00:18 +0000)
in order to reflect the various recent improvements.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12468>

src/compiler/nir/nir_opt_shrink_vectors.c

index 5fdcadf..e61f783 100644 (file)
 /**
  * @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