[llvm] [SPIR-V] Avoid exponential path enumeration in findPathsToMatch (PR #212933)
Arseniy Obolenskiy via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 30 06:56:39 PDT 2026
================
@@ -213,29 +214,52 @@ class ConvergenceRegionAnalyzer {
SmallPtrSet<BasicBlock *, 0>
findPathsToMatch(LoopInfo &LI, BasicBlock *From,
std::function<bool(const BasicBlock *)> isMatch) const {
- SmallPtrSet<BasicBlock *, 0> Output;
-
- if (isMatch(From))
- Output.insert(From);
+ // Compute the postorder of the blocks forward-reachable from |From|,
+ // ignoring back edges. Successors therefore always appear before their
+ // predecessors in the resulting list.
+ SmallVector<BasicBlock *, 16> PostOrder;
----------------
aobolensk wrote:
TIL. Thanks, yes, they are helpful
https://github.com/llvm/llvm-project/pull/212933
More information about the llvm-commits
mailing list