[PATCH] D153078: [clang][dataflow] Change iteration algorithm to use WTO instead of reverse post order.

Yitzhak Mandelbaum via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 15 14:30:29 PDT 2023


ymandel created this revision.
ymandel added reviewers: xazax.hun, gribozavr.
Herald added a subscriber: martong.
Herald added a reviewer: NoQ.
Herald added a project: All.
ymandel requested review of this revision.
Herald added a project: clang.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D153078

Files:
  clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp
  clang/unittests/Analysis/FlowSensitive/LoggerTest.cpp
  clang/unittests/Analysis/FlowSensitive/TransferTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153078.531908.patch
Type: text/x-patch
Size: 3019 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230615/82199ee3/attachment.bin>


More information about the cfe-commits mailing list