This is an archive of the discontinued LLVM Phabricator instance.

[clang][dataflow] Change iteration algorithm to use WTO instead of reverse post order.
Needs ReviewPublic

Authored by ymandel on Jun 15 2023, 2:30 PM.

Details

Summary

This patch replaces use of the reverse-post order (RPO) based worklist with one
based on a weak topological order (WTO). The WTO gives better guarantees on
maximum number of times we'll visit each node in the CFG. The new test case
fails (because of too many iterations) with RPO but passes with WTO.

Ideally, we could iterate using WTO directly without a worklist, but this isn't
yet possible because our widening is limited to booleans. Once we have full
widening at loop heads, we can simplify further to guide the iteration directly
from the WTO's structure.

Diff Detail

Event Timeline

ymandel created this revision.Jun 15 2023, 2:30 PM
Herald added a project: Restricted Project. · View Herald Transcript
Herald added a subscriber: martong. · View Herald Transcript
ymandel requested review of this revision.Jun 15 2023, 2:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 15 2023, 2:30 PM
kinu added a subscriber: kinu.Jun 21 2023, 3:19 AM