pan/bi: Assume non-null sources in constant folding
authorAlyssa Rosenzweig <alyssa@collabora.com>
Mon, 25 Jul 2022 19:04:59 +0000 (15:04 -0400)
committerMarge Bot <emma+marge@anholt.net>
Fri, 2 Sep 2022 16:03:23 +0000 (16:03 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17794>

src/panfrost/bifrost/bi_opt_constant_fold.c

index bf174fb..03c370e 100644 (file)
@@ -42,9 +42,7 @@ bi_fold_constant(bi_instr *I, bool *unsupported)
 {
         /* We can only fold instructions where all sources are constant */
         bi_foreach_src(I, s) {
-                enum bi_index_type type = I->src[s].type;
-
-                if (!(type == BI_INDEX_NULL || type == BI_INDEX_CONSTANT)) {
+                if (I->src[s].type != BI_INDEX_CONSTANT) {
                         *unsupported = true;
                         return 0;
                 }