[llvm] 5ce326c - [SelectionDAG] Construct SmallVector with ArrayRef (NFC) (#103705)

via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 14 08:22:23 PDT 2024


Author: Kazu Hirata
Date: 2024-08-14T08:22:20-07:00
New Revision: 5ce326ccb1f4326e643682a701417b481fe343cd

URL: https://github.com/llvm/llvm-project/commit/5ce326ccb1f4326e643682a701417b481fe343cd
DIFF: https://github.com/llvm/llvm-project/commit/5ce326ccb1f4326e643682a701417b481fe343cd.diff

LOG: [SelectionDAG] Construct SmallVector with ArrayRef (NFC) (#103705)

Added: 
    

Modified: 
    llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 608d17072c39f..625eca6c0e230 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -2278,9 +2278,7 @@ SDValue DAGCombiner::visitMERGE_VALUES(SDNode *N) {
   AddUsersToWorklist(N);
   do {
     // Do as a single replacement to avoid rewalking use lists.
-    SmallVector<SDValue, 8> Ops;
-    for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i)
-      Ops.push_back(N->getOperand(i));
+    SmallVector<SDValue, 8> Ops(N->ops());
     DAG.ReplaceAllUsesWith(N, Ops.data());
   } while (!N->use_empty());
   deleteAndRecombine(N);


        


More information about the llvm-commits mailing list