Skip to contentSkip to conversation

Disable liveness "dead" instruction by default.

PATCH In review Christopher Li 2 participants 2 messages Feb 10, 2007 – Feb 28, 2007 Sparse checker

lore
Share & tools
lore

Christopher Li

author maintainer
#0 lore raw

PATCH 1/1 Disable liveness "dead" instruction by default.

The liveness instruction take up about 10% of the bytecode bloat file. It is not very useful, it is duplicate information can be obtain from the def/user chain.

This change disable the liveness instruction by default. The caller can track_pseudo_death() if needed.

lib.c +3 -1
Index: sparse/lib.c
===================================================================
@@ -191,7 +191,8 @@ int Wenum_mismatch = 1;
 int Wdo_while = 1;
 int Wuninitialized = 1;
 
-int dbg_entry;
+int dbg_entry = 0;
+int dbg_dead = 0;
 
 int preprocess_only;
 char *include;
@@ -391,6 +392,7 @@ static char **handle_switch_W(char *arg,
 
 static struct warning debugs[] = {
 	{ "entry", &dbg_entry},
+	{ "dead", &dbg_dead},
 };
 
 
example.c +1 -0
Index: sparse/example.c
===================================================================
@@ -1946,6 +1946,7 @@ int main(int argc, char **argv)
 	char *file;
 
 	compile(sparse_initialize(argc, argv, &filelist));
+	dbg_dead = 1;
 	FOR_EACH_PTR_NOTAG(filelist, file) {
 		compile(sparse(file));
 	} END_FOR_EACH_PTR_NOTAG(file);
lib.h +1 -0
Index: sparse/lib.h
===================================================================
@@ -98,6 +98,7 @@ extern int Wdo_while;
 extern int Wuninitialized;
 
 extern int dbg_entry;
+extern int dbg_dead;
 
 extern void declare_builtin_functions(void);
 extern void create_builtin_stream(void);
linearize.c +2 -1
Index: sparse/linearize.c
===================================================================
@@ -2134,7 +2134,8 @@ repeat:
 	}
 
 	/* Finally, add deathnotes to pseudos now that we have them */
-	track_pseudo_death(ep);
+	if (dbg_dead)
+		track_pseudo_death(ep);
 
 	return ep;
 }
#1 lore raw
Quoted 8 lines · Christopher Li

The liveness instruction take up about 10% of the bytecode bloat file. It is not very useful, it is duplicate information can be obtain from the def/user chain.

This change disable the liveness instruction by default. The caller can track_pseudo_death() if needed.

Good idea; applied.

- Josh Triplett