diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2017-04-18 14:49:38 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2021-03-08 01:30:54 +0100 |
| commit | 3caeefd911a54289bbf7d293289964239a6fed96 (patch) | |
| tree | a7353efee7b502cb2c3792919fac4676787b8583 /linearize.h | |
| parent | 60c1f2706e30eacc29296e6cb5d9327c85a01340 (diff) | |
| download | sparse-dev-3caeefd911a54289bbf7d293289964239a6fed96.tar.gz | |
phi-sources can only have a single user (or none)
Currently, OP_PHISOURCES have a list as member, 'phi_users',
that should link to all phi-nodes using them but:
*) phi-sources are never shared between phi-nodes
*) this list is useless because it's only created during liveness
and not used after.
So, replace the list by a simple pointer to hold the unique phi-node
using it and keep this link updated during all its lifetime.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'linearize.h')
| -rw-r--r-- | linearize.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/linearize.h b/linearize.h index a77e4b3e..18f1d80f 100644 --- a/linearize.h +++ b/linearize.h @@ -109,7 +109,7 @@ struct instruction { }; struct /* phi source */ { pseudo_t phi_src; - struct instruction_list *phi_users; + struct instruction *phi_node; }; struct /* unops */ { pseudo_t src; @@ -292,6 +292,12 @@ static inline void use_pseudo(struct instruction *insn, pseudo_t p, pseudo_t *pp add_pseudo_user_ptr(alloc_pseudo_user(insn, pp), &p->users); } +static inline void link_phi(struct instruction *node, pseudo_t phi) +{ + use_pseudo(node, phi, add_pseudo(&node->phi_list, phi)); + phi->def->phi_node = node; +} + static inline void remove_bb_from_list(struct basic_block_list **list, struct basic_block *entry, int count) { delete_ptr_list_entry((struct ptr_list **)list, entry, count); |
