aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineOutliner.cpp
diff options
context:
space:
mode:
authorJessica Paquette <jpaquette@apple.com>2023-02-03 16:08:50 -0800
committerJessica Paquette <jpaquette@apple.com>2023-02-03 16:41:02 -0800
commitec37ebf59be78665caa679d46607a2f054155c55 (patch)
tree9ca502312deb0fad3eaa119cadd31c2945f2a158 /llvm/lib/CodeGen/MachineOutliner.cpp
parenta772f0bb920a4957fb94dd8dbe45943809fd0ec3 (diff)
downloadllvm-ec37ebf59be78665caa679d46607a2f054155c55.zip
llvm-ec37ebf59be78665caa679d46607a2f054155c55.tar.gz
llvm-ec37ebf59be78665caa679d46607a2f054155c55.tar.bz2
[NFC] Use SmallVector/ArrayRef in MachineOutliner/SuffixTree for small types
The MachineOutliner + SuffixTree both used `std::vector` everywhere because I didn't know any better at the time. At least for small types, such as `unsigned` and iterators, I can't see any particular reason to use std::vector over `SmallVector` here.
Diffstat (limited to 'llvm/lib/CodeGen/MachineOutliner.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineOutliner.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/MachineOutliner.cpp b/llvm/lib/CodeGen/MachineOutliner.cpp
index a7422f6..358a22f 100644
--- a/llvm/lib/CodeGen/MachineOutliner.cpp
+++ b/llvm/lib/CodeGen/MachineOutliner.cpp
@@ -136,11 +136,11 @@ struct InstructionMapper {
DenseMap<MachineBasicBlock *, unsigned> MBBFlagsMap;
/// The vector of unsigned integers that the module is mapped to.
- std::vector<unsigned> UnsignedVec;
+ SmallVector<unsigned> UnsignedVec;
/// Stores the location of the instruction associated with the integer
/// at index i in \p UnsignedVec for each index i.
- std::vector<MachineBasicBlock::iterator> InstrList;
+ SmallVector<MachineBasicBlock::iterator> InstrList;
// Set if we added an illegal number in the previous step.
// Since each illegal number is unique, we only need one of them between
@@ -157,8 +157,8 @@ struct InstructionMapper {
unsigned mapToLegalUnsigned(
MachineBasicBlock::iterator &It, bool &CanOutlineWithPrevInstr,
bool &HaveLegalRange, unsigned &NumLegalInBlock,
- std::vector<unsigned> &UnsignedVecForMBB,
- std::vector<MachineBasicBlock::iterator> &InstrListForMBB) {
+ SmallVector<unsigned> &UnsignedVecForMBB,
+ SmallVector<MachineBasicBlock::iterator> &InstrListForMBB) {
// We added something legal, so we should unset the AddedLegalLastTime
// flag.
AddedIllegalLastTime = false;
@@ -211,8 +211,8 @@ struct InstructionMapper {
/// \returns The integer that \p *It was mapped to.
unsigned mapToIllegalUnsigned(
MachineBasicBlock::iterator &It, bool &CanOutlineWithPrevInstr,
- std::vector<unsigned> &UnsignedVecForMBB,
- std::vector<MachineBasicBlock::iterator> &InstrListForMBB) {
+ SmallVector<unsigned> &UnsignedVecForMBB,
+ SmallVector<MachineBasicBlock::iterator> &InstrListForMBB) {
// Can't outline an illegal instruction. Set the flag.
CanOutlineWithPrevInstr = false;
@@ -287,8 +287,8 @@ struct InstructionMapper {
// FIXME: Should this all just be handled in the target, rather than using
// repeated calls to getOutliningType?
- std::vector<unsigned> UnsignedVecForMBB;
- std::vector<MachineBasicBlock::iterator> InstrListForMBB;
+ SmallVector<unsigned> UnsignedVecForMBB;
+ SmallVector<MachineBasicBlock::iterator> InstrListForMBB;
LLVM_DEBUG(dbgs() << "*** Mapping outlinable ranges ***\n");
for (auto &OutlinableRange : OutlinableRanges) {