[PATCH] shrink struct BB

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 linearize.h | 12 +++++-------
 ssa.c       |  1 +
 2 files changed, 6 insertions(+), 7 deletions(-)

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);
-- 
2.29.2




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux