1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
From 0d55d24aa4e47c40f74e0281d023089cfaafcf74 Mon Sep 17 00:00:00 2001
From: Jakub Jelinek <jakub@redhat.com>
Date: Thu, 6 May 2021 14:05:06 +0200
Subject: [PATCH 16/35] [Backport] phiopt: Use gphi *phi instead of gimple *phi
some more
Reference: https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=cfd65e8d5299a7cf7d2ecd92b0e24ea4cfb697d9
Various functions in phiopt are also called with a gphi * but use
gimple * argument for it.
2021-05-06 Jakub Jelinek <jakub@redhat.com>
* tree-ssa-phiopt.c (value_replacement, minmax_replacement,
abs_replacement, xor_replacement,
cond_removal_in_popcount_clz_ctz_pattern,
replace_phi_edge_with_variable): Change type of phi argument from
gimple * to gphi *.
---
gcc/tree-ssa-phiopt.c | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c
index 51a2d3684..045a7b1b8 100644
--- a/gcc/tree-ssa-phiopt.c
+++ b/gcc/tree-ssa-phiopt.c
@@ -59,21 +59,21 @@ static bool match_simplify_replacement (basic_block, basic_block,
static gphi *factor_out_conditional_conversion (edge, edge, gphi *, tree, tree,
gimple *);
static int value_replacement (basic_block, basic_block,
- edge, edge, gimple *, tree, tree);
+ edge, edge, gphi *, tree, tree);
static bool minmax_replacement (basic_block, basic_block,
- edge, edge, gimple *, tree, tree);
+ edge, edge, gphi *, tree, tree);
static bool abs_replacement (basic_block, basic_block,
- edge, edge, gimple *, tree, tree);
+ edge, edge, gphi *, tree, tree);
static bool spaceship_replacement (basic_block, basic_block,
edge, edge, gphi *, tree, tree);
static bool cond_removal_in_popcount_clz_ctz_pattern (basic_block, basic_block,
- edge, edge, gimple *,
+ edge, edge, gphi *,
tree, tree);
static bool cond_store_replacement (basic_block, basic_block, edge, edge,
hash_set<tree> *);
static bool cond_if_else_store_replacement (basic_block, basic_block, basic_block);
static hash_set<tree> * get_non_trapping ();
-static void replace_phi_edge_with_variable (basic_block, edge, gimple *, tree);
+static void replace_phi_edge_with_variable (basic_block, edge, gphi *, tree);
static void hoist_adjacent_loads (basic_block, basic_block,
basic_block, basic_block);
static bool do_phiopt_pattern (basic_block, basic_block, basic_block);
@@ -389,7 +389,7 @@ tree_ssa_phiopt_worker (bool do_store_elim, bool do_hoist_loads, bool early_p)
static void
replace_phi_edge_with_variable (basic_block cond_block,
- edge e, gimple *phi, tree new_tree)
+ edge e, gphi *phi, tree new_tree)
{
basic_block bb = gimple_bb (phi);
basic_block block_to_remove;
@@ -1129,8 +1129,7 @@ absorbing_element_p (tree_code code, tree arg, bool right, tree rval)
static int
value_replacement (basic_block cond_bb, basic_block middle_bb,
- edge e0, edge e1, gimple *phi,
- tree arg0, tree arg1)
+ edge e0, edge e1, gphi *phi, tree arg0, tree arg1)
{
gimple_stmt_iterator gsi;
gimple *cond;
@@ -1438,8 +1437,7 @@ value_replacement (basic_block cond_bb, basic_block middle_bb,
static bool
minmax_replacement (basic_block cond_bb, basic_block middle_bb,
- edge e0, edge e1, gimple *phi,
- tree arg0, tree arg1)
+ edge e0, edge e1, gphi *phi, tree arg0, tree arg1)
{
tree result, type, rhs;
gcond *cond;
@@ -2240,7 +2238,7 @@ spaceship_replacement (basic_block cond_bb, basic_block middle_bb,
static bool
cond_removal_in_popcount_clz_ctz_pattern (basic_block cond_bb,
basic_block middle_bb,
- edge e1, edge e2, gimple *phi,
+ edge e1, edge e2, gphi *phi,
tree arg0, tree arg1)
{
gimple *cond;
@@ -2398,7 +2396,7 @@ cond_removal_in_popcount_clz_ctz_pattern (basic_block cond_bb,
static bool
abs_replacement (basic_block cond_bb, basic_block middle_bb,
edge e0 ATTRIBUTE_UNUSED, edge e1,
- gimple *phi, tree arg0, tree arg1)
+ gphi *phi, tree arg0, tree arg1)
{
tree result;
gassign *new_stmt;
--
2.27.0.windows.1
|