[llvm] Reapply "[VPlan] Extract reverse mask from reverse accesses" (PR #189930)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 6 02:28:03 PDT 2026


================
@@ -1057,12 +1061,20 @@ InstructionCost VPRecipeWithIRFlags::getCostForRecipeWithOpcode(
              Opcode == Instruction::FPExt) {
       if (auto *Recipe = Operand->getDefiningRecipe()) {
         VPValue *ReverseOp;
-        if (match(Recipe, m_Reverse(m_VPValue(ReverseOp))))
+        if (match(Recipe,
+                  m_CombineOr(
+                      m_Reverse(m_VPValue(ReverseOp)),
+                      m_Intrinsic<Intrinsic::experimental_vp_reverse>(
+                          m_VPValue(ReverseOp), m_VPValue(), m_VPValue())))) {
----------------
lukel97 wrote:

I think this will also work since m_Intrinsic doesn't check the total number of arguments?

```suggestion
                      m_Intrinsic<Intrinsic::experimental_vp_reverse>(
                          m_VPValue(ReverseOp))))) {
```

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


More information about the llvm-commits mailing list