entel/compiler: Simplify new_idom reduction in dominance tree calculation
authorFrancisco Jerez <currojerez@riseup.net>
Fri, 11 Mar 2016 04:56:47 +0000 (20:56 -0800)
committerMatt Turner <mattst88@gmail.com>
Fri, 6 Mar 2020 18:21:07 +0000 (10:21 -0800)
Trivial, just use a few less tokens to do the same thing.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4012>

src/intel/compiler/brw_cfg.cpp

index b681e098ab625d893581bd07443f30044549cae6..e476ea3621748091eb898ac4c9970c5b4e143024 100644 (file)
@@ -554,11 +554,8 @@ idom_tree::idom_tree(const backend_shader *s) :
          bblock_t *new_idom = NULL;
          foreach_list_typed(bblock_link, parent_link, link, &block->parents) {
             if (parent(parent_link->block)) {
-               if (new_idom == NULL) {
-                  new_idom = parent_link->block;
-               } else if (parent(parent_link->block) != NULL) {
-                  new_idom = intersect(parent_link->block, new_idom);
-               }
+               new_idom = (new_idom ? intersect(new_idom, parent_link->block) :
+                           parent_link->block);
             }
          }