This is an archive of the discontinued LLVM Phabricator instance.

Replacing recursion by cycle in file "SimplifyCFG.cpp", removing the deprecated option.
Needs RevisionPublic

Authored by dbakunevich on Aug 20 2021, 3:11 AM.

Details

Reviewers
apilipenko
nikic
Summary

This change is directed at this TODO:

// TODO: While this recursion limit does prevent pathological behavior, it would be better to track visited instructions to avoid cycles.

These changes are intended to replace recursion with a loop in "dominatesMergePoint". After the replacement, the deprecated option remained, which was also removed.

Diff Detail

Event Timeline

dbakunevich created this revision.Aug 20 2021, 3:11 AM
dbakunevich requested review of this revision.Aug 20 2021, 3:11 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 20 2021, 3:11 AM
dbakunevich edited the summary of this revision. (Show Details)Aug 20 2021, 3:14 AM
nikic requested changes to this revision.Aug 20 2021, 3:25 AM
nikic added a subscriber: nikic.

This is not what the TODO is about. The TODO is about not visiting operands repeatedly if they occur multiple times.

This revision now requires changes to proceed.Aug 20 2021, 3:25 AM

I will hopefully soon post a patch that removes dominatesMergePoint(), it's just wrong so i'm not sure it's worth improving it.

dbakunevich retitled this revision from Replacing recursion by cycle in file "as", removing the deprecated option. to Replacing recursion by cycle in file "SimplifyCFG.cpp", removing the deprecated option..Aug 20 2021, 3:32 AM

This is not what the TODO is about. The TODO is about not visiting operands repeatedly if they occur multiple times.

I will hopefully soon post a patch that removes dominatesMergePoint(), it's just wrong so i'm not sure it's worth improving it.

I realized that I misunderstood this "todo". It is necessary to add another "SmallPtrSet", which will keep track of set unique elements.

Does it make sense to make these changes or wait for "dominatesMergePoint ()" to be removed in the future?