intel/compiler: Move idom tree calculation and related logic into analysis object
[mesa.git] / src / intel / compiler / brw_fs_combine_constants.cpp
index ec48a74ba0b26413f75c03afbaa7940a07c88aca..e07d657db7ad2185fdd5f8771e4de9a59b08e2f9 100644 (file)
@@ -360,7 +360,7 @@ fs_visitor::opt_combine_constants()
    table.len = 0;
    table.imm = ralloc_array(const_ctx, struct imm, table.size);
 
-   cfg->calculate_idom();
+   const brw::idom_tree &idom = idom_analysis.require();
    unsigned ip = -1;
 
    /* Make a pass through all instructions and count the number of times each
@@ -395,7 +395,7 @@ fs_visitor::opt_combine_constants()
          struct imm *imm = find_imm(&table, data, size);
 
          if (imm) {
-            bblock_t *intersection = cfg_t::intersect(block, imm->block);
+            bblock_t *intersection = idom.intersect(block, imm->block);
             if (intersection != imm->block)
                imm->inst = NULL;
             imm->block = intersection;