This is an archive of the discontinued LLVM Phabricator instance.

[LVI] Remove recursion from getValueForCondition (NFC)
ClosedPublic

Authored by critson on Jun 12 2021, 11:37 PM.

Details

Summary

Convert getValueForCondition to a worklist model instead of using
recursion.

In pathological cases getValueForCondition recurses heavily.
Stack frames are quite expensive on x86-64, and some operating
systems (e.g. Windows) have relatively low stack size limits.
Using a worklist avoids potential failures from stack overflow.

Diff Detail

Event Timeline

critson created this revision.Jun 12 2021, 11:37 PM
critson requested review of this revision.Jun 12 2021, 11:37 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 12 2021, 11:37 PM

Ping.
As this is NFC, I will submit in a few days if there are no comments.

This revision was not accepted when it landed; it landed in state Needs Review.Jun 23 2021, 5:58 PM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.