aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-12-27 10:44:01 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-12-27 11:08:00 +0100
commit2272cfe11fc7a34553013a0322b027dadc477064 (patch)
treefbaf010fa149a5e51d5713fae62e6a6ec9809aeb
parent1b896707d95982c7c9cdd5cd0ab4afd80f766a94 (diff)
downloadsparse-2272cfe11fc7a34553013a0322b027dadc477064.tar.gz
shrink struct BB
Reorganize the members of struct BB, avoiding padding and making better use of the union, to shrink its size from 104 to 96 bytes. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--linearize.h12
-rw-r--r--ssa.c1
2 files changed, 6 insertions, 7 deletions
diff --git a/linearize.h b/linearize.h
index 2c548d43..7093a815 100644
--- a/linearize.h
+++ b/linearize.h
@@ -160,21 +160,19 @@ struct instruction_list;
struct basic_block {
struct position pos;
unsigned long generation;
- union {
- int context;
- int postorder_nr; /* postorder number */
- int dom_level; /* level in the dominance tree */
- };
struct entrypoint *ep;
struct basic_block_list *parents; /* sources */
struct basic_block_list *children; /* destinations */
struct instruction_list *insns; /* Linear list of instructions */
struct basic_block *idom; /* link to the immediate dominator */
+ unsigned int nr; /* unique id for label's names */
+ int dom_level; /* level in the dominance tree */
struct basic_block_list *doms; /* list of BB idominated by this one */
- struct phi_map *phi_map;
struct pseudo_list *needs, *defines;
union {
- unsigned int nr; /* unique id for label's names */
+ struct phi_map *phi_map;/* needed during SSA conversion */
+ int postorder_nr; /* postorder number */
+ int context; /* needed during context checking */
void *priv;
};
};
diff --git a/ssa.c b/ssa.c
index a2e27030..4c86c55c 100644
--- a/ssa.c
+++ b/ssa.c
@@ -387,6 +387,7 @@ void ssa_convert(struct entrypoint *ep)
int nr = bb->nr;
if (nr > last)
last = nr;
+ bb->phi_map = NULL;
} END_FOR_EACH_PTR(bb);
processed = sset_init(first, last);