[llvm] [VPlan] Add new VPInstruction ocpode for header mask. (PR #89603)

via llvm-commits llvm-commits at lists.llvm.org
Mon May 6 03:45:44 PDT 2024


================
@@ -595,6 +568,19 @@ static void legalizeAndOptimizeInductions(VPlan &Plan, ScalarEvolution &SE) {
     auto *WideIV = dyn_cast<VPWidenIntOrFpInductionRecipe>(&Phi);
     if (!WideIV)
       continue;
+
+    // If there is a header mask, check if WideIV is canonical IV with other
+    // wide users. If that is the case, use it as HeaderMask's operand, so it
+    // can be used when lowering the recipe.
----------------
ayalz wrote:

Is this part needed to retain current behavior, and deserves a TODO to simplify it?

Will this be simpler if the abstract HeaderMask is a "live-in" VPValue of loop region, free of any operands, i.e., using neither the scalar canonical IV nor a wide canonical/WideIV.

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


More information about the llvm-commits mailing list