@@ -1244,10 +1244,12 @@ class BoUpSLP {
1244
1244
};
1245
1245
1246
1246
using ValueList = SmallVector<Value *, 8>;
1247
+ using InstrList = SmallVector<Instruction *, 16>;
1247
1248
using ValueSet = SmallPtrSet<Value *, 16>;
1249
+ using StoreList = SmallVector<StoreInst *, 8>;
1248
1250
using ExtraValueToDebugLocsMap =
1249
1251
MapVector<Value *, SmallVector<Instruction *, 2>>;
1250
- using OrdersType = SmallVector<unsigned, 0 >;
1252
+ using OrdersType = SmallVector<unsigned, 4 >;
1251
1253
1252
1254
BoUpSLP(Function *Func, ScalarEvolution *Se, TargetTransformInfo *Tti,
1253
1255
TargetLibraryInfo *TLi, AAResults *Aa, LoopInfo *Li,
@@ -1469,7 +1471,7 @@ class BoUpSLP {
1469
1471
/// \param TryRecursiveCheck used to check if long masked gather can be
1470
1472
/// represented as a serie of loads/insert subvector, if profitable.
1471
1473
LoadsState canVectorizeLoads(ArrayRef<Value *> VL, const Value *VL0,
1472
- OrdersType &Order,
1474
+ SmallVectorImpl<unsigned> &Order,
1473
1475
SmallVectorImpl<Value *> &PointerOps,
1474
1476
bool TryRecursiveCheck = true) const;
1475
1477
@@ -2838,7 +2840,7 @@ class BoUpSLP {
2838
2840
/// \param ResizeAllowed indicates whether it is allowed to handle subvector
2839
2841
/// extract order.
2840
2842
bool canReuseExtract(ArrayRef<Value *> VL, Value *OpValue,
2841
- OrdersType &CurrentOrder,
2843
+ SmallVectorImpl<unsigned> &CurrentOrder,
2842
2844
bool ResizeAllowed = false) const;
2843
2845
2844
2846
/// Vectorize a single entry in the tree.
@@ -3082,10 +3084,10 @@ class BoUpSLP {
3082
3084
CombinedOpcode CombinedOp = NotCombinedOp;
3083
3085
3084
3086
/// Does this sequence require some shuffling?
3085
- SmallVector<int, 0 > ReuseShuffleIndices;
3087
+ SmallVector<int, 4 > ReuseShuffleIndices;
3086
3088
3087
3089
/// Does this entry require reordering?
3088
- OrdersType ReorderIndices;
3090
+ SmallVector<unsigned, 4> ReorderIndices;
3089
3091
3090
3092
/// Points back to the VectorizableTree.
3091
3093
///
@@ -4298,12 +4300,12 @@ static void reorderReuses(SmallVectorImpl<int> &Reuses, ArrayRef<int> Mask) {
4298
4300
/// the original order of the scalars. Procedure transforms the provided order
4299
4301
/// in accordance with the given \p Mask. If the resulting \p Order is just an
4300
4302
/// identity order, \p Order is cleared.
4301
- static void reorderOrder(BoUpSLP::OrdersType &Order, ArrayRef<int> Mask,
4303
+ static void reorderOrder(SmallVectorImpl<unsigned> &Order, ArrayRef<int> Mask,
4302
4304
bool BottomOrder = false) {
4303
4305
assert(!Mask.empty() && "Expected non-empty mask.");
4304
4306
unsigned Sz = Mask.size();
4305
4307
if (BottomOrder) {
4306
- BoUpSLP::OrdersType PrevOrder;
4308
+ SmallVector<unsigned> PrevOrder;
4307
4309
if (Order.empty()) {
4308
4310
PrevOrder.resize(Sz);
4309
4311
std::iota(PrevOrder.begin(), PrevOrder.end(), 0);
@@ -4693,7 +4695,7 @@ getShuffleCost(const TargetTransformInfo &TTI, TTI::ShuffleKind Kind,
4693
4695
}
4694
4696
4695
4697
BoUpSLP::LoadsState BoUpSLP::canVectorizeLoads(
4696
- ArrayRef<Value *> VL, const Value *VL0, OrdersType &Order,
4698
+ ArrayRef<Value *> VL, const Value *VL0, SmallVectorImpl<unsigned> &Order,
4697
4699
SmallVectorImpl<Value *> &PointerOps, bool TryRecursiveCheck) const {
4698
4700
// Check that a vectorized load would load the same memory as a scalar
4699
4701
// load. For example, we don't want to vectorize loads that are smaller
@@ -4821,7 +4823,7 @@ BoUpSLP::LoadsState BoUpSLP::canVectorizeLoads(
4821
4823
for (unsigned Cnt = 0, End = VL.size(); Cnt + VF <= End;
4822
4824
Cnt += VF, ++VectorizedCnt) {
4823
4825
ArrayRef<Value *> Slice = VL.slice(Cnt, VF);
4824
- OrdersType Order;
4826
+ SmallVector<unsigned> Order;
4825
4827
SmallVector<Value *> PointerOps;
4826
4828
LoadsState LS =
4827
4829
canVectorizeLoads(Slice, Slice.front(), Order, PointerOps,
@@ -5395,7 +5397,7 @@ void BoUpSLP::reorderNodeWithReuses(TreeEntry &TE, ArrayRef<int> Mask) const {
5395
5397
TE.ReorderIndices.clear();
5396
5398
// Try to improve gathered nodes with clustered reuses, if possible.
5397
5399
ArrayRef<int> Slice = ArrayRef(NewMask).slice(0, Sz);
5398
- OrdersType NewOrder(Slice);
5400
+ SmallVector<unsigned> NewOrder(Slice);
5399
5401
inversePermutation(NewOrder, NewMask);
5400
5402
reorderScalars(TE.Scalars, NewMask);
5401
5403
// Fill the reuses mask with the identity submasks.
@@ -7715,7 +7717,7 @@ unsigned BoUpSLP::canMapToVector(Type *T) const {
7715
7717
}
7716
7718
7717
7719
bool BoUpSLP::canReuseExtract(ArrayRef<Value *> VL, Value *OpValue,
7718
- OrdersType &CurrentOrder,
7720
+ SmallVectorImpl<unsigned> &CurrentOrder,
7719
7721
bool ResizeAllowed) const {
7720
7722
const auto *It = find_if(VL, IsaPred<ExtractElementInst, ExtractValueInst>);
7721
7723
assert(It != VL.end() && "Expected at least one extract instruction.");
0 commit comments