[llvm] [RISCV] Use slideup to lower build_vector when its last operand is an extraction (PR #154450)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 22 00:07:17 PDT 2025


================
@@ -4512,42 +4512,97 @@ static SDValue lowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG,
          "Illegal type which will result in reserved encoding");
 
   const unsigned Policy = RISCVVType::TAIL_AGNOSTIC | RISCVVType::MASK_AGNOSTIC;
+  auto getVSlide = [&](bool SlideUp, EVT ContainerVT, SDValue Passthru,
----------------
lukel97 wrote:

Nit, probably better to use an explicit captures list
```suggestion
  auto getVSlide = [&DAG, &Subtarget](bool SlideUp, EVT ContainerVT, SDValue Passthru,
                       SDValue Vec, SDValue Offset, SDValue Mask,
                       SDValue VL) -> SDValue {
```

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


More information about the llvm-commits mailing list