nir/instr_set: Assume SSA
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Tue, 1 Aug 2023 16:33:31 +0000 (12:33 -0400)
committerMarge Bot <emma+marge@anholt.net>
Thu, 3 Aug 2023 22:40:29 +0000 (22:40 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>

src/compiler/nir/nir_instr_set.c

index d84a259..5d2d106 100644 (file)
 #include "nir_vla.h"
 #include "util/half_float.h"
 
-static bool
-src_is_ssa(nir_src *src, void *data)
-{
-   (void) data;
-   return src->is_ssa;
-}
-
-static bool
-dest_is_ssa(nir_dest *dest, void *data)
-{
-   (void) data;
-   return dest->is_ssa;
-}
-
-ASSERTED static inline bool
-instr_each_src_and_dest_is_ssa(const nir_instr *instr)
-{
-   if (!nir_foreach_dest((nir_instr *)instr, dest_is_ssa, NULL) ||
-       !nir_foreach_src((nir_instr *)instr, src_is_ssa, NULL))
-      return false;
-
-   return true;
-}
-
 /* This function determines if uses of an instruction can safely be rewritten
  * to use another identical instruction instead. Note that this function must
  * be kept in sync with hash_instr() and nir_instrs_equal() -- only
@@ -322,19 +298,7 @@ hash_instr(const void *data)
 bool
 nir_srcs_equal(nir_src src1, nir_src src2)
 {
-   if (src1.is_ssa) {
-      if (src2.is_ssa) {
-         return src1.ssa == src2.ssa;
-      } else {
-         return false;
-      }
-   } else {
-      if (src2.is_ssa) {
-         return false;
-      } else {
-         return src1.reg.reg == src2.reg.reg;
-      }
-   }
+   return src1.ssa == src2.ssa;
 }
 
 /**