Skip to content

Commit 2d52eb6

Browse files
committed
[SLP][NFC]Remove unused using declarations, reduce mem usage in containers, NFC
1 parent c7df775 commit 2d52eb6

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,12 +1244,10 @@ class BoUpSLP {
12441244
};
12451245

12461246
using ValueList = SmallVector<Value *, 8>;
1247-
using InstrList = SmallVector<Instruction *, 16>;
12481247
using ValueSet = SmallPtrSet<Value *, 16>;
1249-
using StoreList = SmallVector<StoreInst *, 8>;
12501248
using ExtraValueToDebugLocsMap =
12511249
MapVector<Value *, SmallVector<Instruction *, 2>>;
1252-
using OrdersType = SmallVector<unsigned, 4>;
1250+
using OrdersType = SmallVector<unsigned, 0>;
12531251

12541252
BoUpSLP(Function *Func, ScalarEvolution *Se, TargetTransformInfo *Tti,
12551253
TargetLibraryInfo *TLi, AAResults *Aa, LoopInfo *Li,
@@ -1471,7 +1469,7 @@ class BoUpSLP {
14711469
/// \param TryRecursiveCheck used to check if long masked gather can be
14721470
/// represented as a serie of loads/insert subvector, if profitable.
14731471
LoadsState canVectorizeLoads(ArrayRef<Value *> VL, const Value *VL0,
1474-
SmallVectorImpl<unsigned> &Order,
1472+
OrdersType &Order,
14751473
SmallVectorImpl<Value *> &PointerOps,
14761474
bool TryRecursiveCheck = true) const;
14771475

@@ -2840,7 +2838,7 @@ class BoUpSLP {
28402838
/// \param ResizeAllowed indicates whether it is allowed to handle subvector
28412839
/// extract order.
28422840
bool canReuseExtract(ArrayRef<Value *> VL, Value *OpValue,
2843-
SmallVectorImpl<unsigned> &CurrentOrder,
2841+
OrdersType &CurrentOrder,
28442842
bool ResizeAllowed = false) const;
28452843

28462844
/// Vectorize a single entry in the tree.
@@ -3084,10 +3082,10 @@ class BoUpSLP {
30843082
CombinedOpcode CombinedOp = NotCombinedOp;
30853083

30863084
/// Does this sequence require some shuffling?
3087-
SmallVector<int, 4> ReuseShuffleIndices;
3085+
SmallVector<int, 0> ReuseShuffleIndices;
30883086

30893087
/// Does this entry require reordering?
3090-
SmallVector<unsigned, 4> ReorderIndices;
3088+
OrdersType ReorderIndices;
30913089

30923090
/// Points back to the VectorizableTree.
30933091
///
@@ -4300,12 +4298,12 @@ static void reorderReuses(SmallVectorImpl<int> &Reuses, ArrayRef<int> Mask) {
43004298
/// the original order of the scalars. Procedure transforms the provided order
43014299
/// in accordance with the given \p Mask. If the resulting \p Order is just an
43024300
/// identity order, \p Order is cleared.
4303-
static void reorderOrder(SmallVectorImpl<unsigned> &Order, ArrayRef<int> Mask,
4301+
static void reorderOrder(BoUpSLP::OrdersType &Order, ArrayRef<int> Mask,
43044302
bool BottomOrder = false) {
43054303
assert(!Mask.empty() && "Expected non-empty mask.");
43064304
unsigned Sz = Mask.size();
43074305
if (BottomOrder) {
4308-
SmallVector<unsigned> PrevOrder;
4306+
BoUpSLP::OrdersType PrevOrder;
43094307
if (Order.empty()) {
43104308
PrevOrder.resize(Sz);
43114309
std::iota(PrevOrder.begin(), PrevOrder.end(), 0);
@@ -4695,7 +4693,7 @@ getShuffleCost(const TargetTransformInfo &TTI, TTI::ShuffleKind Kind,
46954693
}
46964694

46974695
BoUpSLP::LoadsState BoUpSLP::canVectorizeLoads(
4698-
ArrayRef<Value *> VL, const Value *VL0, SmallVectorImpl<unsigned> &Order,
4696+
ArrayRef<Value *> VL, const Value *VL0, OrdersType &Order,
46994697
SmallVectorImpl<Value *> &PointerOps, bool TryRecursiveCheck) const {
47004698
// Check that a vectorized load would load the same memory as a scalar
47014699
// load. For example, we don't want to vectorize loads that are smaller
@@ -4823,7 +4821,7 @@ BoUpSLP::LoadsState BoUpSLP::canVectorizeLoads(
48234821
for (unsigned Cnt = 0, End = VL.size(); Cnt + VF <= End;
48244822
Cnt += VF, ++VectorizedCnt) {
48254823
ArrayRef<Value *> Slice = VL.slice(Cnt, VF);
4826-
SmallVector<unsigned> Order;
4824+
OrdersType Order;
48274825
SmallVector<Value *> PointerOps;
48284826
LoadsState LS =
48294827
canVectorizeLoads(Slice, Slice.front(), Order, PointerOps,
@@ -5397,7 +5395,7 @@ void BoUpSLP::reorderNodeWithReuses(TreeEntry &TE, ArrayRef<int> Mask) const {
53975395
TE.ReorderIndices.clear();
53985396
// Try to improve gathered nodes with clustered reuses, if possible.
53995397
ArrayRef<int> Slice = ArrayRef(NewMask).slice(0, Sz);
5400-
SmallVector<unsigned> NewOrder(Slice);
5398+
OrdersType NewOrder(Slice);
54015399
inversePermutation(NewOrder, NewMask);
54025400
reorderScalars(TE.Scalars, NewMask);
54035401
// Fill the reuses mask with the identity submasks.
@@ -7717,7 +7715,7 @@ unsigned BoUpSLP::canMapToVector(Type *T) const {
77177715
}
77187716

77197717
bool BoUpSLP::canReuseExtract(ArrayRef<Value *> VL, Value *OpValue,
7720-
SmallVectorImpl<unsigned> &CurrentOrder,
7718+
OrdersType &CurrentOrder,
77217719
bool ResizeAllowed) const {
77227720
const auto *It = find_if(VL, IsaPred<ExtractElementInst, ExtractValueInst>);
77237721
assert(It != VL.end() && "Expected at least one extract instruction.");

0 commit comments

Comments
 (0)