This is an archive of the discontinued LLVM Phabricator instance.

[DAGCombine] Make CombineTo prune nodes more aggressively.
AbandonedPublic

Authored by niravd on Aug 11 2017, 9:18 PM.

Details

Reviewers
dbabokin
Summary

Currently CombineTo will only delete the replaced node but not any of
its operands which allows some simplification in concurrent node
replacement, but may allow unused nodes from persisting which may
prevent optimizations that apply only when single uses are around. It
also permits CombineTo patterns which may trigger assertions due to
CSE elimination. This change prunes nodes more aggressively fixing hte
unused nodes issue and increasing the likelihood that assertions
trigger when CombineTo is incorrectly applied.

Fixes for minor changes are included in this patch. A thorough check
of cases should be run to shake out additional cases.

This should likely be done to the ReplaceAllUsesWith procedures as well.

Event Timeline

niravd created this revision.Aug 11 2017, 9:18 PM
niravd planned changes to this revision.Aug 11 2017, 9:22 PM

This is not ready yet, as it needs much more testing to shake out any missing cases. dbabokin should be able to find a number with his testing infrastructure.

dbabokin edited edge metadata.Aug 15 2017, 10:46 AM

I've run it through 1.6M tests on x86 (-O3) and found nothing. This makes me pretty sure that my run will not find anything new in reasonable time.

niravd abandoned this revision.Mar 29 2019, 12:06 PM

rL357283 supersedes this.