[llvm] [VPlan][Predicator] Simplify block mask by using PostDomFrontier (PR #186478)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 24 07:10:52 PDT 2026
https://github.com/ayalz commented:
Taking the OR of the edge masks from post-dom frontier to its post-dom'd successors is described in "All You Need Is Superword-Level Parallelism", PLDI'22 (Fig. 8), along with Gated-SSA.
One way to prevent potential degradations is to compare the cost of its result with that of the existing solution, employing the more efficient one in each case. I.e., compare the size of post-dom frontier (edges to post-dom'd successors to account for switches) vs. the number of immediate predecessors (incoming edges). These numbers correspond to the number of OR's used; the former saves the AND of computing an edge mask if it's reused, i.e., if the post-dom'd successor is other than the current block. But doing so increases code complexity and compile-time.
Sounds like for most if not all current practical purposes the IR stays the same, in which case perhaps worth leaving a comment with the current straightforward implementation, until profitable use-cases are found?
https://github.com/llvm/llvm-project/pull/186478
More information about the llvm-commits
mailing list