linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* basic block output order?
@ 2006-12-12 10:24 Christopher Li
  2006-12-12 16:36 ` Linus Torvalds
  0 siblings, 1 reply; 4+ messages in thread
From: Christopher Li @ 2006-12-12 10:24 UTC (permalink / raw)
  To: linux-sparse; +Cc: Linus Torvalds

I am playing with the example.c. I am wondering why the parent
basic blocks need to generate first?

The entry point has it's own "entry" instruction now, it should
remain as the first basic block in entry->bbs.

e.g. what is wrong with the following patch?

The reason I ask is because I think I need a few more pass
on the basic block. I try to avoid recursive if it is not necessary.

Thanks

Chris

Index: sparse/flow.c
===================================================================
--- sparse.orig/flow.c	2006-12-12 01:52:06.000000000 -0800
+++ sparse/flow.c	2006-12-12 01:52:40.000000000 -0800
@@ -903,12 +903,10 @@ void vrfy_flow(struct entrypoint *ep)
 	struct basic_block *bb;
 	struct basic_block *entry = ep->entry->bb;
 
+	assert(first_basic_block(ep->bbs) == entry);
 	FOR_EACH_PTR(ep->bbs, bb) {
-		if (bb == entry)
-			entry = NULL;
 		vrfy_bb_flow(bb);
 	} END_FOR_EACH_PTR(bb);
-	assert(!entry);
 }
 
 void pack_basic_blocks(struct entrypoint *ep)
Index: sparse/example.c
===================================================================
--- sparse.orig/example.c	2006-12-12 01:52:06.000000000 -0800
+++ sparse/example.c	2006-12-12 01:52:40.000000000 -0800
@@ -1765,9 +1765,6 @@ static void output_bb(struct basic_block
 
 	bb->generation = generation;
 
-	/* Make sure all parents have been generated first */
-	generate_list(bb->parents, generation);
-
 	state.pos = bb->pos;
 	state.inputs = gather_storage(bb, STOR_IN);
 	state.outputs = gather_storage(bb, STOR_OUT);
@@ -1782,9 +1779,6 @@ static void output_bb(struct basic_block
 
 	free_ptr_list(&state.inputs);
 	free_ptr_list(&state.outputs);
-
-	/* Generate all children... */
-	generate_list(bb->children, generation);
 }
 
 /*
@@ -1920,7 +1914,7 @@ static void output(struct entrypoint *ep
 	arch_set_up_storage(ep);
 
 	/* Show the results ... */
-	output_bb(ep->entry->bb, generation);
+	generate_list(ep->bbs, generation);
 
 	/* Clear the storage hashes for the next function.. */
 	free_storage();

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-12-13  2:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-12 10:24 basic block output order? Christopher Li
2006-12-12 16:36 ` Linus Torvalds
2006-12-13  1:15   ` Christopher Li
2006-12-13  1:44     ` Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).