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

Mel Chen via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 4 07:03:52 PDT 2026


================
@@ -1639,6 +1639,26 @@ static void simplifyRecipe(VPSingleDefRecipe *Def, VPTypeAnalysis &TypeInfo) {
     return;
   }
 
+  if (match(Def, m_Reverse(m_Intrinsic<Intrinsic::vector_splice_left>(
+                     m_Poison(), m_VPValue(X), m_VPValue(Y)))) &&
+      match(Y, m_EVL(m_VPValue()))) {
----------------
Mel-Chen wrote:

Since the transformation is now primarily EVL-driven, we don't need to care about cases where the offset is not an EVL. However, I checked this anyway :D
This rule actually only holds true when the offset is less than or equal to VL. This is because when the evl argument > VL, vp.reverse behaves identically to evl == VL (which is just a vector.reverse), whereas slice.left would evaluate to poison.

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


More information about the llvm-commits mailing list