Skip to content

Commit

Permalink
[SLP][NFC]Fix naming of variables/functions, NFC.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-bataev committed Nov 28, 2023
1 parent 87d884b commit c728842
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -791,8 +791,8 @@ static bool allSameType(ArrayRef<Value *> VL) {

/// \returns True if in-tree use also needs extract. This refers to
/// possible scalar operand in vectorized instruction.
static bool InTreeUserNeedToExtract(Value *Scalar, Instruction *UserInst,
TargetLibraryInfo *TLI) {
static bool doesInTreeUserNeedToExtract(Value *Scalar, Instruction *UserInst,
TargetLibraryInfo *TLI) {
unsigned Opcode = UserInst->getOpcode();
switch (Opcode) {
case Instruction::Load: {
Expand Down Expand Up @@ -3663,7 +3663,7 @@ template <> struct GraphTraits<BoUpSLP *> {
template <> struct DOTGraphTraits<BoUpSLP *> : public DefaultDOTGraphTraits {
using TreeEntry = BoUpSLP::TreeEntry;

DOTGraphTraits(bool isSimple = false) : DefaultDOTGraphTraits(isSimple) {}
DOTGraphTraits(bool IsSimple = false) : DefaultDOTGraphTraits(IsSimple) {}

std::string getNodeLabel(const TreeEntry *Entry, const BoUpSLP *R) {
std::string Str;
Expand Down Expand Up @@ -4947,7 +4947,7 @@ void BoUpSLP::buildExternalUses(
if (UseScalar != U ||
UseEntry->State == TreeEntry::ScatterVectorize ||
UseEntry->State == TreeEntry::PossibleStridedVectorize ||
!InTreeUserNeedToExtract(Scalar, UserInst, TLI)) {
!doesInTreeUserNeedToExtract(Scalar, UserInst, TLI)) {
LLVM_DEBUG(dbgs() << "SLP: \tInternal user will be removed:" << *U
<< ".\n");
assert(UseEntry->State != TreeEntry::NeedToGather && "Bad state");
Expand Down Expand Up @@ -12763,7 +12763,7 @@ void BoUpSLP::BlockScheduling::calculateDependencies(ScheduleData *SD,
}
}

auto makeControlDependent = [&](Instruction *I) {
auto MakeControlDependent = [&](Instruction *I) {
auto *DepDest = getScheduleData(I);
assert(DepDest && "must be in schedule window");
DepDest->ControlDependencies.push_back(BundleMember);
Expand All @@ -12785,7 +12785,7 @@ void BoUpSLP::BlockScheduling::calculateDependencies(ScheduleData *SD,
continue;

// Add the dependency
makeControlDependent(I);
MakeControlDependent(I);

if (!isGuaranteedToTransferExecutionToSuccessor(I))
// Everything past here must be control dependent on I.
Expand All @@ -12811,7 +12811,7 @@ void BoUpSLP::BlockScheduling::calculateDependencies(ScheduleData *SD,
continue;

// Add the dependency
makeControlDependent(I);
MakeControlDependent(I);
}
}

Expand All @@ -12829,7 +12829,7 @@ void BoUpSLP::BlockScheduling::calculateDependencies(ScheduleData *SD,
continue;

// Add the dependency
makeControlDependent(I);
MakeControlDependent(I);
break;
}
}
Expand All @@ -12844,7 +12844,7 @@ void BoUpSLP::BlockScheduling::calculateDependencies(ScheduleData *SD,
"NextLoadStore list for non memory effecting bundle?");
MemoryLocation SrcLoc = getLocation(SrcInst);
bool SrcMayWrite = BundleMember->Inst->mayWriteToMemory();
unsigned numAliased = 0;
unsigned NumAliased = 0;
unsigned DistToSrc = 1;

for (; DepDest; DepDest = DepDest->NextLoadStore) {
Expand All @@ -12859,13 +12859,13 @@ void BoUpSLP::BlockScheduling::calculateDependencies(ScheduleData *SD,
// check this limit even between two read-only instructions.
if (DistToSrc >= MaxMemDepDistance ||
((SrcMayWrite || DepDest->Inst->mayWriteToMemory()) &&
(numAliased >= AliasedCheckLimit ||
(NumAliased >= AliasedCheckLimit ||
SLP->isAliased(SrcLoc, SrcInst, DepDest->Inst)))) {

// We increment the counter only if the locations are aliased
// (instead of counting all alias checks). This gives a better
// balance between reduced runtime and accurate dependencies.
numAliased++;
NumAliased++;

DepDest->MemoryDependencies.push_back(BundleMember);
BundleMember->Dependencies++;
Expand Down Expand Up @@ -12967,20 +12967,20 @@ void BoUpSLP::scheduleBlock(BlockScheduling *BS) {

// Do the "real" scheduling.
while (!ReadyInsts.empty()) {
ScheduleData *picked = *ReadyInsts.begin();
ScheduleData *Picked = *ReadyInsts.begin();
ReadyInsts.erase(ReadyInsts.begin());

// Move the scheduled instruction(s) to their dedicated places, if not
// there yet.
for (ScheduleData *BundleMember = picked; BundleMember;
for (ScheduleData *BundleMember = Picked; BundleMember;
BundleMember = BundleMember->NextInBundle) {
Instruction *pickedInst = BundleMember->Inst;
if (pickedInst->getNextNode() != LastScheduledInst)
pickedInst->moveBefore(LastScheduledInst);
LastScheduledInst = pickedInst;
Instruction *PickedInst = BundleMember->Inst;
if (PickedInst->getNextNode() != LastScheduledInst)
PickedInst->moveBefore(LastScheduledInst);
LastScheduledInst = PickedInst;
}

BS->schedule(picked, ReadyInsts);
BS->schedule(Picked, ReadyInsts);
}

// Check that we didn't break any of our invariants.
Expand Down Expand Up @@ -13695,8 +13695,8 @@ bool SLPVectorizerPass::tryToVectorizeList(ArrayRef<Value *> VL, BoUpSLP &R,
// NOTE: the following will give user internal llvm type name, which may
// not be useful.
R.getORE()->emit([&]() {
std::string type_str;
llvm::raw_string_ostream rso(type_str);
std::string TypeStr;
llvm::raw_string_ostream rso(TypeStr);
Ty->print(rso);
return OptimizationRemarkMissed(SV_NAME, "UnsupportedType", I0)
<< "Cannot SLP vectorize list: type "
Expand Down

0 comments on commit c728842

Please sign in to comment.