Propagator should call value_of_stmt.
authorAndrew MacLeod <amacleod@redhat.com>
Thu, 31 Mar 2022 13:36:59 +0000 (09:36 -0400)
committerAndrew MacLeod <amacleod@redhat.com>
Thu, 16 Jun 2022 18:02:25 +0000 (14:02 -0400)
When evaluating the LHS of a stmt, its more efficent/better to call
value_of_stmt directly rather than value_of_expr.

* tree-ssa-propagate.cc (before_dom_children): Call value_of_stmt.

gcc/tree-ssa-propagate.cc

index c10ffd9..5983f02 100644 (file)
@@ -813,7 +813,7 @@ substitute_and_fold_dom_walker::before_dom_children (basic_block bb)
       tree lhs = gimple_get_lhs (stmt);
       if (lhs && TREE_CODE (lhs) == SSA_NAME)
        {
-         tree sprime = substitute_and_fold_engine->value_of_expr (lhs, stmt);
+         tree sprime = substitute_and_fold_engine->value_of_stmt (stmt, lhs);
          if (sprime
              && sprime != lhs
              && may_propagate_copy (lhs, sprime)