[PATCH] D131646: [clang][dataflow] Restructure loops to call widen on back edges

2022-08-19 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp:228-234 + // If we are at the start of a loop, we will have two precessors, but we don't + // want to join these two predecessors. Instead, we want to take the back e

[PATCH] D131646: [clang][dataflow] Restructure loops to call widen on back edges

2022-08-19 Thread Eric Li via Phabricator via cfe-commits
li.zhe.hua added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp:168-169 +// back edge block. (That is, all paths from the entry block to the back edge +// block must go through `Block`.) It also means that there are only two +// pred

[PATCH] D131646: [clang][dataflow] Restructure loops to call widen on back edges

2022-08-19 Thread Eric Li via Phabricator via cfe-commits
li.zhe.hua updated this revision to Diff 454089. li.zhe.hua marked 4 inline comments as done. li.zhe.hua added a comment. Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131646/new/ https://reviews.llvm.org/D131646 Files: clang/li

[PATCH] D131646: [clang][dataflow] Restructure loops to call widen on back edges

2022-08-12 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp:157 +// Returns whether `Block` is a "back edge" in the CFG. Such a block has only +// one successor, the start of the loop. Let's start function comments

[PATCH] D131646: [clang][dataflow] Restructure loops to call widen on back edges

2022-08-11 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp:228-234 + // If we are at the start of a loop, we will have two precessors, but we don't + // want to join these two predecessors. Instead, we want to take the back e

[PATCH] D131646: [clang][dataflow] Restructure loops to call widen on back edges

2022-08-11 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp:228-234 + // If we are at the start of a loop, we will have two precessors, but we don't + // want to join these two predecessors. Instead, we want to take the back e

[PATCH] D131646: [clang][dataflow] Restructure loops to call widen on back edges

2022-08-11 Thread Eric Li via Phabricator via cfe-commits
li.zhe.hua marked an inline comment as done. li.zhe.hua added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp:168-169 +// back edge block. (That is, all paths from the entry block to the back edge +// block must go through `Block`.) I

[PATCH] D131646: [clang][dataflow] Restructure loops to call widen on back edges

2022-08-11 Thread Eric Li via Phabricator via cfe-commits
li.zhe.hua updated this revision to Diff 451926. li.zhe.hua added a comment. Fix incorrect assumption that back edge blocks have an empty body. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131646/new/ https://reviews.llvm.org/D131646 Files: cla

[PATCH] D131646: [clang][dataflow] Restructure loops to call widen on back edges

2022-08-11 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp:168-169 +// back edge block. (That is, all paths from the entry block to the back edge +// block must go through `Block`.) It also means that there are only two +// prede

[PATCH] D131646: [clang][dataflow] Restructure loops to call widen on back edges

2022-08-11 Thread Eric Li via Phabricator via cfe-commits
li.zhe.hua added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp:180 + assert(Block->pred_size() == 2); + BackEdge = Pred; +} ymandel wrote: > Might it be worth simply returning the backedge when you find

[PATCH] D131646: [clang][dataflow] Restructure loops to call widen on back edges

2022-08-11 Thread Eric Li via Phabricator via cfe-commits
li.zhe.hua updated this revision to Diff 451861. li.zhe.hua marked 2 inline comments as done. li.zhe.hua added a comment. Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131646/new/ https://reviews.llvm.org/D131646 Files: clang/li

[PATCH] D131646: [clang][dataflow] Restructure loops to call widen on back edges

2022-08-11 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel accepted this revision. ymandel added a comment. This revision is now accepted and ready to land. Nice! Comment at: clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp:180 + assert(Block->pred_size() == 2); + BackEdge = Pred; +} ---

[PATCH] D131646: [clang][dataflow] Restructure loops to call widen on back edges

2022-08-10 Thread Eric Li via Phabricator via cfe-commits
li.zhe.hua created this revision. Herald added subscribers: martong, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All. li.zhe.hua requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. When navigating a loop block, we call the