This is an archive of the discontinued LLVM Phabricator instance.

[PredicateInfo] Invalidate an OrderedBasicBlock when instruction in it is deleted.
AbandonedPublic

Authored by trentxintong on Jun 29 2017, 11:18 AM.

Details

Summary

PredicateInfo uses OrderedBasicBlock and NewGVN which uses PredicateInfo should keep
it updated and correct.

Event Timeline

trentxintong created this revision.Jun 29 2017, 11:18 AM
dberlin requested changes to this revision.Jun 29 2017, 1:22 PM

Without a reason to do this specifically, it seems a waste of time

None of this data is used after initial building, and all of these are destroyed after newgvn ends, so updating them doesn't seem to accomplish anything?

This revision now requires changes to proceed.Jun 29 2017, 1:22 PM

Without a reason to do this specifically, it seems a waste of time

None of this data is used after initial building, and all of these are destroyed after newgvn ends, so updating them doesn't seem to accomplish anything?

I was making the Instruction * in OrdereBasicBlock AssertingVH to make sure things are updated properly when instructions are deleted. If they are not, we are essentially holding a dangling pointer which could in worst case result in invalid dominance relationship being returned. Then i found NewGVN is breaking the rule, i.e. erasing an instruction without updating OrderedBasicBlock in OrderedInstruction.

I agree the way NewGVN is written now is ok even without updating the OrderedBasicBlock. Maybe we should not make Instruction * in OBB AssertingVH. Instead should give user the freedom to invalidate if necessary.

trentxintong abandoned this revision.Jun 30 2017, 6:14 PM

This is no longer necessary as discussed on the list.