aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2024-08-04 00:41:29 -0700
committerGitHub <noreply@github.com>2024-08-04 00:41:29 -0700
commit8d1b17b6623742ec4454f5bae2e23f8b30124314 (patch)
tree5967c3998629a2c4807519ddcc541c83bbde5792 /llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
parent533190acdb9d2ed774f96a998b5c03be3df4f857 (diff)
downloadllvm-8d1b17b6623742ec4454f5bae2e23f8b30124314.zip
llvm-8d1b17b6623742ec4454f5bae2e23f8b30124314.tar.gz
llvm-8d1b17b6623742ec4454f5bae2e23f8b30124314.tar.bz2
[CodeGen] Construct SmallVector with ArrayRef (NFC) (#101841)
Diffstat (limited to 'llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp')
-rw-r--r--llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp b/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
index 7eb6cd4..925a1c7 100644
--- a/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
@@ -646,7 +646,7 @@ MachineInstrBuilder MachineIRBuilder::buildMergeValues(const DstOp &Res,
// Unfortunately to convert from ArrayRef<LLT> to ArrayRef<SrcOp>,
// we need some temporary storage for the DstOp objects. Here we use a
// sufficiently large SmallVector to not go through the heap.
- SmallVector<SrcOp, 8> TmpVec(Ops.begin(), Ops.end());
+ SmallVector<SrcOp, 8> TmpVec(Ops);
assert(TmpVec.size() > 1);
return buildInstr(TargetOpcode::G_MERGE_VALUES, Res, TmpVec);
}
@@ -657,7 +657,7 @@ MachineIRBuilder::buildMergeLikeInstr(const DstOp &Res,
// Unfortunately to convert from ArrayRef<LLT> to ArrayRef<SrcOp>,
// we need some temporary storage for the DstOp objects. Here we use a
// sufficiently large SmallVector to not go through the heap.
- SmallVector<SrcOp, 8> TmpVec(Ops.begin(), Ops.end());
+ SmallVector<SrcOp, 8> TmpVec(Ops);
assert(TmpVec.size() > 1);
return buildInstr(getOpcodeForMerge(Res, TmpVec), Res, TmpVec);
}
@@ -685,7 +685,7 @@ MachineInstrBuilder MachineIRBuilder::buildUnmerge(ArrayRef<LLT> Res,
// Unfortunately to convert from ArrayRef<LLT> to ArrayRef<DstOp>,
// we need some temporary storage for the DstOp objects. Here we use a
// sufficiently large SmallVector to not go through the heap.
- SmallVector<DstOp, 8> TmpVec(Res.begin(), Res.end());
+ SmallVector<DstOp, 8> TmpVec(Res);
assert(TmpVec.size() > 1);
return buildInstr(TargetOpcode::G_UNMERGE_VALUES, TmpVec, Op);
}
@@ -702,7 +702,7 @@ MachineInstrBuilder MachineIRBuilder::buildUnmerge(ArrayRef<Register> Res,
// Unfortunately to convert from ArrayRef<Register> to ArrayRef<DstOp>,
// we need some temporary storage for the DstOp objects. Here we use a
// sufficiently large SmallVector to not go through the heap.
- SmallVector<DstOp, 8> TmpVec(Res.begin(), Res.end());
+ SmallVector<DstOp, 8> TmpVec(Res);
assert(TmpVec.size() > 1);
return buildInstr(TargetOpcode::G_UNMERGE_VALUES, TmpVec, Op);
}
@@ -712,7 +712,7 @@ MachineInstrBuilder MachineIRBuilder::buildBuildVector(const DstOp &Res,
// Unfortunately to convert from ArrayRef<Register> to ArrayRef<SrcOp>,
// we need some temporary storage for the DstOp objects. Here we use a
// sufficiently large SmallVector to not go through the heap.
- SmallVector<SrcOp, 8> TmpVec(Ops.begin(), Ops.end());
+ SmallVector<SrcOp, 8> TmpVec(Ops);
return buildInstr(TargetOpcode::G_BUILD_VECTOR, Res, TmpVec);
}
@@ -739,7 +739,7 @@ MachineIRBuilder::buildBuildVectorTrunc(const DstOp &Res,
// Unfortunately to convert from ArrayRef<Register> to ArrayRef<SrcOp>,
// we need some temporary storage for the DstOp objects. Here we use a
// sufficiently large SmallVector to not go through the heap.
- SmallVector<SrcOp, 8> TmpVec(Ops.begin(), Ops.end());
+ SmallVector<SrcOp, 8> TmpVec(Ops);
if (TmpVec[0].getLLTTy(*getMRI()).getSizeInBits() ==
Res.getLLTTy(*getMRI()).getElementType().getSizeInBits())
return buildInstr(TargetOpcode::G_BUILD_VECTOR, Res, TmpVec);
@@ -789,7 +789,7 @@ MachineIRBuilder::buildConcatVectors(const DstOp &Res, ArrayRef<Register> Ops) {
// Unfortunately to convert from ArrayRef<Register> to ArrayRef<SrcOp>,
// we need some temporary storage for the DstOp objects. Here we use a
// sufficiently large SmallVector to not go through the heap.
- SmallVector<SrcOp, 8> TmpVec(Ops.begin(), Ops.end());
+ SmallVector<SrcOp, 8> TmpVec(Ops);
return buildInstr(TargetOpcode::G_CONCAT_VECTORS, Res, TmpVec);
}