Skip to content

Commit f74acd3

Browse files
author
Leon Clark
committed
Remove auto.
1 parent 019e39f commit f74acd3

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

llvm/lib/Transforms/Vectorize/VectorCombine.cpp

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "llvm/IR/Dominators.h"
2929
#include "llvm/IR/Function.h"
3030
#include "llvm/IR/IRBuilder.h"
31+
#include "llvm/IR/Instructions.h"
3132
#include "llvm/IR/PatternMatch.h"
3233
#include "llvm/Support/CommandLine.h"
3334
#include "llvm/Transforms/Utils/Local.h"
@@ -3506,7 +3507,7 @@ bool VectorCombine::shrinkLoadForShuffles(Instruction &I) {
35063507
using IndexRange = std::pair<int, int>;
35073508
auto GetIndexRangeInShuffles = [&]() -> std::optional<IndexRange> {
35083509
IndexRange OutputRange = IndexRange(OldNumElements, -1);
3509-
for (auto &Use : I.uses()) {
3510+
for (llvm::Use &Use : I.uses()) {
35103511
// Ensure all uses match the required pattern.
35113512
User *Shuffle = Use.getUser();
35123513
ArrayRef<int> Mask;
@@ -3535,13 +3536,13 @@ bool VectorCombine::shrinkLoadForShuffles(Instruction &I) {
35353536
};
35363537

35373538
// Get the range of vector elements used by shufflevector instructions.
3538-
if (auto Indices = GetIndexRangeInShuffles()) {
3539+
if (std::optional<IndexRange> Indices = GetIndexRangeInShuffles()) {
35393540
unsigned const NewNumElements = Indices->second + 1u;
35403541

35413542
// If the range of vector elements is smaller than the full load, attempt
35423543
// to create a smaller load.
35433544
if (NewNumElements < OldNumElements) {
3544-
auto Builder = IRBuilder(&I);
3545+
IRBuilder Builder(&I);
35453546
Builder.SetCurrentDebugLocation(I.getDebugLoc());
35463547

35473548
// Calculate costs of old and new ops.
@@ -3557,17 +3558,17 @@ bool VectorCombine::shrinkLoadForShuffles(Instruction &I) {
35573558
OldLoad->getPointerAddressSpace(), CostKind);
35583559

35593560
using UseEntry = std::pair<ShuffleVectorInst *, std::vector<int>>;
3560-
auto NewUses = SmallVector<UseEntry, 4u>();
3561-
auto SizeDiff = OldNumElements - NewNumElements;
3561+
SmallVector<UseEntry, 4u> NewUses;
3562+
unsigned const SizeDiff = OldNumElements - NewNumElements;
35623563

3563-
for (auto &Use : I.uses()) {
3564+
for (llvm::Use &Use : I.uses()) {
35643565
auto *Shuffle = cast<ShuffleVectorInst>(Use.getUser());
3565-
auto OldMask = Shuffle->getShuffleMask();
3566+
ArrayRef<int> OldMask = Shuffle->getShuffleMask();
35663567

35673568
// Create entry for new use.
35683569
NewUses.push_back({Shuffle, {}});
3569-
auto &NewMask = NewUses.back().second;
3570-
for (auto Index : OldMask)
3570+
std::vector<int> &NewMask = NewUses.back().second;
3571+
for (int Index : OldMask)
35713572
NewMask.push_back(Index >= static_cast<int>(OldNumElements)
35723573
? Index - SizeDiff
35733574
: Index);
@@ -3588,13 +3589,13 @@ bool VectorCombine::shrinkLoadForShuffles(Instruction &I) {
35883589
NewLoad->copyMetadata(I);
35893590

35903591
// Replace all uses.
3591-
for (auto &Use : NewUses) {
3592-
auto *Shuffle = Use.first;
3593-
auto &NewMask = Use.second;
3592+
for (UseEntry &Use : NewUses) {
3593+
ShuffleVectorInst *Shuffle = Use.first;
3594+
std::vector<int> &NewMask = Use.second;
35943595

35953596
Builder.SetInsertPoint(Shuffle);
35963597
Builder.SetCurrentDebugLocation(Shuffle->getDebugLoc());
3597-
auto *NewShuffle = Builder.CreateShuffleVector(
3598+
Value *NewShuffle = Builder.CreateShuffleVector(
35983599
NewLoad, PoisonValue::get(NewLoadTy), NewMask);
35993600

36003601
replaceValue(*Shuffle, *NewShuffle);

0 commit comments

Comments
 (0)