[llvm] [NFC][LV]: Differentiate between Pred and Unpred masked operations. (PR #169509)
Hassnaa Hamdi via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 10 04:16:48 PDT 2026
================
@@ -714,9 +717,16 @@ class LoopVectorizationLegality {
AssumptionCache *AC;
/// While vectorizing these instructions we have to generate a
- /// call to the appropriate masked intrinsic or drop them in case of
- /// conditional assumes.
- SmallPtrSet<const Instruction *, 8> MaskedOp;
+ /// call to the appropriate masked intrinsic or drop them.
+ /// In order to differentiate between control flow introduced at the source
+ /// level and that introduced by the loop vectoriser during tail-folding, we
+ /// keep two lists:
+ /// 1) UnpredMaskedOp - instructions that need masking if we are
+ /// in conditionally executed block.
+ /// 2) PredMaskedOp - instructions that need masking if we are in
+ /// a predicated loop.
+ SmallPtrSet<const Instruction *, 8> UnpredMaskedOps;
+ SmallPtrSet<const Instruction *, 8> PredMaskedOps;
----------------
hassnaaHamdi wrote:
These are the names I used in the draft patch:
`SmallPtrSet<const Instruction *, 8> MaskedOp;`
` SmallPtrSet<const Instruction *, 8> TailFoldedMaskedOp;`
I think these are better ?
https://github.com/llvm/llvm-project/pull/169509
More information about the llvm-commits
mailing list