[llvm] [VPlan] Extract reverse operation for reverse accesses (PR #146525)
Mel Chen via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 5 02:29:23 PDT 2025
================
@@ -2339,6 +2355,39 @@ static void transformRecipestoEVLRecipes(VPlan &Plan, VPValue &EVL) {
CurVPV->replaceAllUsesWith(EVLRecipe->getVPSingleValue());
}
ToErase.push_back(CurRecipe);
+
+ // Convert general reverse operations on loaded values and stored values
+ // into vp.reverse, when the VPVectorEndPointerRecipe adjusting the access
+ // address uses EVL instead of VF.
+ // TODO: Extend conversion along the def-use/use-def chain, as reverse
+ // operations may be eliminated or moved in the future.
----------------
Mel-Chen wrote:
This is because in the future, a reverse might be eliminated or moved by SimplifyRecipe.
Implementing this wouldn’t be too difficult; for a reverse load as example, we could collect users recursively with collectUsersRecursively and transform the reverse accordingly. However, this situation doesn’t currently occur, so there’s no example to verify correctness, which is why I haven’t done it yet.
Do I need to tackle this TODO now?
https://github.com/llvm/llvm-project/pull/146525
More information about the llvm-commits
mailing list