[llvm] [VPlan] Move predication to VPlanTransform (NFC). (PR #128420)

via llvm-commits llvm-commits at lists.llvm.org
Tue May 20 07:01:48 PDT 2025


================
@@ -68,15 +68,7 @@ class VPRecipeBuilder {
 
   VPBuilder &Builder;
 
-  /// When we if-convert we need to create edge masks. We have to cache values
-  /// so that we don't end up with exponential recursion/IR. Note that
-  /// if-conversion currently takes place during VPlan-construction, so these
-  /// caches are only used at that stage.
-  using EdgeMaskCacheTy =
-      DenseMap<std::pair<BasicBlock *, BasicBlock *>, VPValue *>;
-  using BlockMaskCacheTy = DenseMap<BasicBlock *, VPValue *>;
-  EdgeMaskCacheTy EdgeMaskCache;
-  BlockMaskCacheTy BlockMaskCache;
+  DenseMap<VPBasicBlock *, VPValue *> &BlockMaskCache;
----------------
ayalz wrote:

```suggestion
  /// The mask of each VPBB, generated earlier and used for predicating recipes in VPBB. TODO: remove by applying predication when generating the masks.
  DenseMap<VPBasicBlock *, VPValue *> &BlockMaskCache;
```
or some other documentation.

https://github.com/llvm/llvm-project/pull/128420


More information about the llvm-commits mailing list