[llvm] [VPlan] Extract reverse operation for reverse accesses (PR #146525)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 17 05:22:06 PDT 2025


================
@@ -3341,3 +3363,34 @@ void VPlanTransforms::addBranchWeightToMiddleTerminator(
       MDB.createBranchWeights({1, VectorStep - 1}, /*IsExpected=*/false);
   MiddleTerm->addMetadata(LLVMContext::MD_prof, BranchWeights);
 }
+
+void VPlanTransforms::adjustRecipesForReverseAccesses(VPlan &Plan) {
----------------
lukel97 wrote:

I just did a quick scan and it looks like the only places where reverse is set is in `VPRecipeBuilder::tryToWidenMemory`. Instead of introducing another transform, should we just insert the `VPInstruction::Reverse`s there to avoid having to iterate over all the recipes again? 

This way would mean we could also remove the `Reverse` field from `VPWidenMemoryRecipe`

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


More information about the llvm-commits mailing list