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

Benjamin Maxwell via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 16 08:20:06 PST 2026


================
@@ -314,11 +329,11 @@ void VPlanTransforms::introduceMasksAndLinearize(VPlan &Plan, bool FoldTail) {
     PrevVPBB = VPBB;
   }
 
-  // If we folded the tail and introduced a header mask, any extract of the
-  // last element must be updated to extract from the last active lane of the
-  // header mask instead (i.e., the lane corresponding to the last active
-  // iteration).
-  if (FoldTail) {
+  // If we folded the  and introduced a header mask, or have partial alias
+  // masking, any extract of the last element must be updated to extract from
+  // the last active lane of the header mask instead (i.e., the lane
+  // corresponding to the last active iteration).
+  if (FoldTail || MaskAliasing) {
----------------
MacDue wrote:

This should extract the last lane from `lane_mask & alias_mask` (there's a test that shows it does this).  Both the `alias_mask` and `lane_mask` are prefix masks, so the result should also be a prefix mask. 

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


More information about the llvm-commits mailing list