On Mon, 2005-04-25 at 12:00, Kazu Hirata wrote: > Hi Andrew, > > I believe DOM uses the routine to create a dummy expression for a store > > which looks like a load. This load is then entered into the equivalency > > tables such that the store of the expression also shows up as a load > > allowing subsequent loads to be subsumed. Or something like that > > anyway. Bottom line is it creates a stmt annotation and operands for an > > expression which is not in any stmt list. > > Does this standalone stmt_ann end up in the instruction stream? That > is, are we going to have a statement as a part of a basic block whose > stmt_ann is the one created in create_ssa_artficial_load_stmt?
no. It never gets linked in, and as such, the immediate use info never gets entered either (which is the way we want it). its a hack of the grandest sort. > > If not, I guess we can let DOM do what it wants to do because I am > currently thinking about simply embedding stmt_ann into > tree_statement_list_node like so. > > struct tree_statement_list_node > GTY ((chain_next ("%h.next"), chain_prev ("%h.prev"))) > { > struct tree_statement_list_node *prev; > struct tree_statement_list_node *next; > tree stmt; > struct stmt_ann_d ann; > }; > well, there isnt a tree_statement_list_node right... DOM simply has an expression, and we end up calling create_stmt_ann. I guess you would have to create a completely detached stmt_list node for this case. what are you planning to have create_stmt_ann do? > Though leaving this standalone stmt_ann as isn't probably the cleanest > thing to do. Eventually, I want to completely hide > creation/destruction of stmt_ann from applications (or optimizers if > you like) of the infrastructure. > I eventually want to see this entire routine go away. The only reason DOM wants it is so that it can scan the operands like it does for a real stmt. noone else needs to do such a thing.. Presumably the overhead of actually inserting these loads immediately after the store and deleting them later is too high... Ive never looked at the details of what DOM does with the info. if it only needs the operands for a short time, a different interface could be provided which returns the operands in a VEC or something. I just never felt like looking at DOM too heavily. > If this standalone stmt_ann does end up in the instruction stream, we > could structure-copy stmt_ann for the time being (yuck!). well, if it ended up in the instruction stream, it wouldn't matter, because then it would simply be another stmt like any other. The fact that it isnt a stmt, and DOM insists on treating it like it is, is what causes the problem. Andrew