Hi Zdenek, > guessing from (*) below, you probably just forgot to mention that it also > involves changing SSA_NAME_DEF_STMT to point to the > tree_statement_list_node rather than the statement itself, > otherwise there is no way how to get the > annotation for SSA_NAME_DEF_STMT (name)?
I am not planning to change SSA_NAME_DEF_STMT yet. If stmt_ann is embedded into tree_statement_list_node, we can compute the address of tree_statement_list_node from that of stmt_ann. I am planning to keep a pointer from a statement proper to a stmt_ann for now. > It is definitely a good idea, IMHO. Thanks! I might need your help later as a loop optimizer expert. I just found yesterday that tree-ssa-loop-im.c:schedule_sm is using stmt_ann before a statement proper is linked to a basic block. Specifically, it creates a statement, attaches a stmt_ann, and puts it on edge. We probably have to one of the following. 1) delay the creation of stmt_ann until after a statement is linked, 2) create a stmt_ann just like we do now, and then copy its contents to stmt_ann embedded in tree_statement_list_node, or 3) create a tree_statement_list_node in schedule_sm, which contains stmt_ann, and link it to a basic block. (This option would require bigger changes as we are currently supposed to put a statement in PENDING_STMT, not a tree_statement_list_node. Plus, bsi_insert_* and tsi_link_* stuff all expect a statement.) Right now I am just instrumenting stmt_ann to see where people are using stmt_ann while a statement is not linked to a basic block. Kazu Hirata