[llvm] [LV] Add initial support for partial alias masking (PR #177599)

Benjamin Maxwell via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 15 09:56:19 PST 2026


================
@@ -300,9 +300,17 @@ class LoopVectorizationLegality {
   /// masking.
   bool canFoldTailByMasking() const;
 
+  /// Returns true if all instructions in the loop support masking or
+  /// speculation.
+  ///
+  /// The mask may be loop-invariant if it represents a maximum safe dependence
+  /// distance (alias mask) or loop-variant if it is based on the induction
+  /// variable (e.g. tail-folding).
+  bool canMaskLoop() const;
----------------
MacDue wrote:

Adding the symbolic `alias-mask` is done as it allows separating attaching the alias mask from materializing it, which requires the diff check information, and inserting a new check block for the runtime VF. 

I think you could remove some of the changes in `LoopVectorizationLegality.h`, `VPlanUtils`, `VPlanAnalysis`, but the patch would need to be in a state where it can easily be followed up with the full alias-masking support. 

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


More information about the llvm-commits mailing list