Skip to content

Commit 0a349d5

Browse files
committed
[SLP] clean up - use 'const' and ArrayRef constructor; NFC
Follow-on tidying suggested in the post-commit review of 6a23668.
1 parent 89aad89 commit 0a349d5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6853,7 +6853,7 @@ class HorizontalReduction {
68536853
BoUpSLP::ExtraValueToDebugLocsMap ExternallyUsedValues;
68546854
// The same extra argument may be used several times, so log each attempt
68556855
// to use it.
6856-
for (std::pair<Instruction *, Value *> &Pair : ExtraArgs) {
6856+
for (const std::pair<Instruction *, Value *> &Pair : ExtraArgs) {
68576857
assert(Pair.first && "DebugLoc must be set.");
68586858
ExternallyUsedValues[Pair.second].push_back(Pair.first);
68596859
}
@@ -6908,7 +6908,7 @@ class HorizontalReduction {
69086908
Value *VectorizedTree = nullptr;
69096909
unsigned i = 0;
69106910
while (i < NumReducedVals - ReduxWidth + 1 && ReduxWidth > 2) {
6911-
ArrayRef<Value *> VL = makeArrayRef(&ReducedVals[i], ReduxWidth);
6911+
ArrayRef<Value *> VL(&ReducedVals[i], ReduxWidth);
69126912
V.buildTree(VL, ExternallyUsedValues, IgnoreList);
69136913
Optional<ArrayRef<unsigned>> Order = V.bestOrder();
69146914
if (Order) {
@@ -7664,7 +7664,7 @@ bool SLPVectorizerPass::vectorizeGEPIndices(BasicBlock *BB, BoUpSLP &R) {
76647664
unsigned MaxElts = MaxVecRegSize / EltSize;
76657665
for (unsigned BI = 0, BE = Entry.second.size(); BI < BE; BI += MaxElts) {
76667666
auto Len = std::min<unsigned>(BE - BI, MaxElts);
7667-
auto GEPList = makeArrayRef(&Entry.second[BI], Len);
7667+
ArrayRef<GetElementPtrInst *> GEPList(&Entry.second[BI], Len);
76687668

76697669
// Initialize a set a candidate getelementptrs. Note that we use a
76707670
// SetVector here to preserve program order. If the index computations

0 commit comments

Comments
 (0)