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

via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 27 03:13:18 PDT 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_ExtractLastElement(const Op0_t &Op0) {
----------------
ayalz wrote:

```suggestion
m_ExtractFinalLane(const Op0_t &Op0) {
```
?
The term `Element` is used to represent a lane when VF>1 and otherwise a part, as in `ExtractPenultimateElement`. Perhaps `FinalLane` would be clearer to represent the last lane of the last part.

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


More information about the llvm-commits mailing list