[llvm] [VPlan] Replace ExtractLast(Elem|LanePerPart) with ExtractLast(Lane/Part) (PR #164124)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 10 05:29:33 PST 2025


================
@@ -395,9 +395,17 @@ m_ExtractElement(const Op0_t &Op0, const Op1_t &Op1) {
 }
 
 template <typename Op0_t>
-inline VPInstruction_match<VPInstruction::ExtractLastLanePerPart, Op0_t>
-m_ExtractLastLanePerPart(const Op0_t &Op0) {
-  return m_VPInstruction<VPInstruction::ExtractLastLanePerPart>(Op0);
+inline VPInstruction_match<VPInstruction::ExtractLastPart, Op0_t>
+m_ExtractLastPart(const Op0_t &Op0) {
+  return m_VPInstruction<VPInstruction::ExtractLastPart>(Op0);
+}
+
+template <typename Op0_t>
+inline VPInstruction_match<
+    VPInstruction::ExtractLastLane,
+    VPInstruction_match<VPInstruction::ExtractLastPart, Op0_t>>
+m_ExtractFinalLane(const Op0_t &Op0) {
+  return m_ExtractLastLane(m_ExtractLastPart(Op0));
----------------
david-arm wrote:

I personally find these matchers quite confusing because in my opinion `Final` and `Last` have the same meaning in this context. I think I would prefer this to be more explicit, i.e. `m_ExtractLastLaneOfLastPart`.

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


More information about the llvm-commits mailing list