On Wed, 2005-08-24 at 18:28 -0400, Daniel Berlin wrote: > > Could someone look into this and see what they can do? > > You should probably ask Diego or Andrew directly whether they'd like us > to do this in bsi_remove (which requires adding an argument) and > remove_phi_node(ditto) so that a lot less has to worry about releasing > defs.
removing a stmt doesn't mean that the def is no longer needed. there could still be uses and a replacement def inserted later. Even if there are currently no uses, that still doesn't mean that the stmt being removed isn't going to be inserted again somewhere else... Then the def on the stmt would not be valid. bsi_remove is simply a wrapper around stmt delinking, it shouldn't have other effects like deciding an SSA_NAME is now unused. Ive never been a big fan of having to call something to release ssa_names, its too bug prone. I would much prefer to see something like a cleanup pass done every once in a while... an ssa-name garbage collector if you will :-). It seems to me that between major optimization passes, any SSA_NAME with no defining stmt, no uses, and isn't a default def of some sort can simply be released. Or at least some similar set of criteria. I suspect immediate uses were not available when release_defs was invented, so this was not easily done. Andrew