diff mbox series

shrink struct BB

Message ID 20201227100829.33456-1-luc.vanoostenryck@gmail.com (mailing list archive)
State Mainlined, archived
Headers show
Series shrink struct BB | expand

Commit Message

Luc Van Oostenryck Dec. 27, 2020, 10:08 a.m. UTC
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>
---
 linearize.h | 12 +++++-------
 ssa.c       |  1 +
 2 files changed, 6 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/linearize.h b/linearize.h
index 2c548d43526f..7093a815312a 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 a2e27030e4b6..4c86c55c2ec1 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);