From 1735e0f2b13af5dcd5826de553320db14835853e Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sat, 22 Mar 2025 11:48:39 -0700 Subject: [PATCH] [llvm] Construct SmallVector with ArrayRef (NFC) --- llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp | 2 +- llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | 3 +-- llvm/lib/Target/RISCV/RISCVISelLowering.cpp | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp index 208fa8475fd4f..a9f80860124fb 100644 --- a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp +++ b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp @@ -183,7 +183,7 @@ void LegalizerHelper::insertParts(Register DstReg, // Merge sub-vectors with different number of elements and insert into DstReg. if (ResultTy.isVector()) { assert(LeftoverRegs.size() == 1 && "Expected one leftover register"); - SmallVector AllRegs(PartRegs.begin(), PartRegs.end()); + SmallVector AllRegs(PartRegs); AllRegs.append(LeftoverRegs.begin(), LeftoverRegs.end()); return mergeMixedSubvectors(DstReg, AllRegs); } diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp index 0db6c614684d7..3a45802b24cc1 100644 --- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp +++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp @@ -17651,8 +17651,7 @@ bool AArch64TargetLowering::lowerInterleaveIntrinsicToStore( Builder.CreateVectorSplat(StTy->getElementCount(), Builder.getTrue()); auto ExtractedValues = InterleavedValues; - SmallVector StoreOperands(InterleavedValues.begin(), - InterleavedValues.end()); + SmallVector StoreOperands(InterleavedValues); if (UseScalable) StoreOperands.push_back(Pred); StoreOperands.push_back(BaseAddr); diff --git a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp index 78ea3ea3738ae..95476a004cc91 100644 --- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp +++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp @@ -23255,8 +23255,7 @@ bool RISCVTargetLowering::lowerInterleaveIntrinsicToStore( SI->getModule(), FixedVssegIntrIds[Factor - 2], {InVTy, SI->getPointerOperandType(), XLenTy}); - SmallVector Ops(InterleaveValues.begin(), - InterleaveValues.end()); + SmallVector Ops(InterleaveValues); Value *VL = ConstantInt::get(XLenTy, FVTy->getNumElements()); Ops.append({SI->getPointerOperand(), VL});