[llvm] [VPlan][NFC] Simplify reverse access pattern detection in EVL vectorization (PR #199510)

Mel Chen via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 10 01:19:11 PDT 2026


================
@@ -3133,6 +3136,26 @@ void VPlanTransforms::optimizeEVLMasks(VPlan &Plan) {
     }
   }
 
+  // Fold the following splice patterns into vp.reverse for reverse accesses:
+  //   vector.reverse(splice.left(poison, x, evl))  -> vp.reverse(x, true, evl)
+  //   splice.right(vector.reverse(x), poison, evl) -> vp.reverse(x, true, evl)
+  for (VPUser *U : collectUsersRecursively(EVL)) {
+    VPValue *X;
+    if (!match(U, m_Reverse(m_Intrinsic<Intrinsic::vector_splice_left>(
+                      m_Poison(), m_VPValue(X), m_Specific(EVL)))) &&
+        !match(U, m_Intrinsic<Intrinsic::vector_splice_right>(
+                      m_Reverse(m_VPValue(X)), m_Poison(), m_Specific(EVL))))
+      continue;
----------------
Mel-Chen wrote:

Sure, thanks.
5fa9252f074899b2cc0ca372eb0abf8b312fbcf2

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


More information about the llvm-commits mailing list