[llvm] [NFC][LV]: Differentiate between Pred and Unpred masked operations. (PR #169509)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 1 06:12:47 PST 2025


================
@@ -2838,7 +2838,8 @@ bool LoopVectorizationCostModel::isPredicatedInst(Instruction *I) const {
   // TODO: We can use the loop-preheader as context point here and get
   // context sensitive reasoning for isSafeToSpeculativelyExecute.
   if (isSafeToSpeculativelyExecute(I) ||
-      (isa<LoadInst, StoreInst, CallInst>(I) && !Legal->isMaskRequired(I)) ||
+      (isa<LoadInst, StoreInst, CallInst>(I) &&
----------------
david-arm wrote:

Is it worth adding a simple wrapper function to LoopVectorizationCostModel, i.e.

```
  LoopVectorizationCostModel::isMaskRequired(Instruction *I) {
    return Legal->isMaskRequired(I, foldTailByMasking());
  }
```

and using this where possible?

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


More information about the llvm-commits mailing list