aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Pinski <apinski@marvell.com>2023-05-02 20:21:12 -0700
committerAndrew Pinski <apinski@marvell.com>2023-05-04 04:23:22 -0700
commit8830e46777407a7d5cd3de353394ffc46f2c785c (patch)
treeccfff6c5f05db42f4d5b9847caf273b4be6ffcc6
parent508f082829af680ec4c1a5bcf55fe464986e3c95 (diff)
downloadgcc-8830e46777407a7d5cd3de353394ffc46f2c785c.zip
gcc-8830e46777407a7d5cd3de353394ffc46f2c785c.tar.gz
gcc-8830e46777407a7d5cd3de353394ffc46f2c785c.tar.bz2
PHIOPT: Improve replace_phi_edge_with_variable's dce_ssa_names slightly
When I added the dce_ssa_names argument, I didn't realize bitmap was a pointer so I used the default argument value as auto_bitmap(). But instead we could just use nullptr and check if it was a nullptr before calling simple_dce_from_worklist. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. gcc/ChangeLog: * tree-ssa-phiopt.cc (replace_phi_edge_with_variable): Change the default argument value for dce_ssa_names to nullptr. Check to make sure dce_ssa_names is a non-nullptr before calling simple_dce_from_worklist.
-rw-r--r--gcc/tree-ssa-phiopt.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/tree-ssa-phiopt.cc b/gcc/tree-ssa-phiopt.cc
index 51f33e1..154a5ab 100644
--- a/gcc/tree-ssa-phiopt.cc
+++ b/gcc/tree-ssa-phiopt.cc
@@ -89,7 +89,7 @@ single_non_singleton_phi_for_edges (gimple_seq seq, edge e0, edge e1)
static void
replace_phi_edge_with_variable (basic_block cond_block,
edge e, gphi *phi, tree new_tree,
- bitmap dce_ssa_names = auto_bitmap())
+ bitmap dce_ssa_names = nullptr)
{
basic_block bb = gimple_bb (phi);
gimple_stmt_iterator gsi;
@@ -164,7 +164,8 @@ replace_phi_edge_with_variable (basic_block cond_block,
gimple_cond_make_true (cond);
}
- simple_dce_from_worklist (dce_ssa_names);
+ if (dce_ssa_names)
+ simple_dce_from_worklist (dce_ssa_names);
statistics_counter_event (cfun, "Replace PHI with variable", 1);