[llvm] [RISCV] Use MutableArrayRef instead of SmallVectorImpl&. NFC (PR #159651)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 18 13:54:27 PDT 2025


https://github.com/topperc created https://github.com/llvm/llvm-project/pull/159651

We're only going to modify exiting items, not add or remove any elements to the vector.

>From 3f9289a2d2375949c629c772857da90aba1638e7 Mon Sep 17 00:00:00 2001
From: Craig Topper <craig.topper at sifive.com>
Date: Thu, 18 Sep 2025 13:52:31 -0700
Subject: [PATCH] [RISCV] Use MutableArrayRef instead of SmallVectorImpl& where
 wew change the contents of the vector but not its size.

---
 llvm/lib/Target/RISCV/RISCVISelLowering.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
index d5240f971f815..71e9bf2a7882f 100644
--- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
@@ -10719,7 +10719,7 @@ static SDValue lowerCttzElts(SDNode *N, SelectionDAG &DAG,
 }
 
 static inline void promoteVCIXScalar(const SDValue &Op,
-                                     SmallVectorImpl<SDValue> &Operands,
+                                     MutableArrayRef<SDValue> Operands,
                                      SelectionDAG &DAG) {
   const RISCVSubtarget &Subtarget =
       DAG.getMachineFunction().getSubtarget<RISCVSubtarget>();
@@ -10755,7 +10755,7 @@ static inline void promoteVCIXScalar(const SDValue &Op,
 }
 
 static void processVCIXOperands(SDValue &OrigOp,
-                                SmallVectorImpl<SDValue> &Operands,
+                                MutableArrayRef<SDValue> Operands,
                                 SelectionDAG &DAG) {
   promoteVCIXScalar(OrigOp, Operands, DAG);
   const RISCVSubtarget &Subtarget =



More information about the llvm-commits mailing list