On Tue, Aug 15, 2017 at 5:43 PM, Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> wrote: > Yes, what I thought for a long while, > But when things like try_ti_simplify_bb() come in play, > with pack_basic_blocks() on top the things become > *very* messy I often you can't make sense of it anymore. It is not only messy, it is plain wrong that SSA dominance property has been violated. >> IOW, you could think of the phi nodes as being "outside" the >> instruction flow entirely, and just being the definition of the pseudo >> they define. They have to be placed somewhere, but the "somewhere" is >> somewhat arbitrary. > > It's true to a certain point, after it, you need to have them placed at > the confluence point. I can't explain better for now. I'll have an > example tomorrow. I give one example in my other email. I think that arbitrary view is actually wrong: phi node is a function that select value depend on which edge the control flow come from. Place it arbitrary cause the phi node does not have access the edge information how the define joined. It need to be place at the dominance frontier, which just barely out of reach of the dominance of the define. > Not directly related to that is that I really think we need to associate > a ph-node's source to it's parent BB. Exactly. Notice that parent ( predecessor) might not be the BB that define the variable. It is where the definition not longer dominance (dominance frontier). Again, the simple way to explain this, it is the requirement of the SSA dominance property. Chris -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html