Skip to content

Commit 83b72cd

Browse files
author
git apple-llvm automerger
committed
Merge commit '1c03cc5a39f7' from llvm.org/master into apple/master
2 parents 79c757a + 1c03cc5 commit 83b72cd

File tree

8 files changed

+183
-182
lines changed

8 files changed

+183
-182
lines changed

llvm/lib/Transforms/Scalar/LICM.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ static bool pointerInvalidatedByLoop(MemoryLocation MemLoc,
155155
static bool pointerInvalidatedByLoopWithMSSA(MemorySSA *MSSA, MemoryUse *MU,
156156
Loop *CurLoop,
157157
SinkAndHoistLICMFlags &Flags);
158-
static Instruction *CloneInstructionInExitBlock(
158+
static Instruction *cloneInstructionInExitBlock(
159159
Instruction &I, BasicBlock &ExitBlock, PHINode &PN, const LoopInfo *LI,
160160
const LoopSafetyInfo *SafetyInfo, MemorySSAUpdater *MSSAU);
161161

@@ -1364,7 +1364,7 @@ static bool isNotUsedOrFreeInLoop(const Instruction &I, const Loop *CurLoop,
13641364
return true;
13651365
}
13661366

1367-
static Instruction *CloneInstructionInExitBlock(
1367+
static Instruction *cloneInstructionInExitBlock(
13681368
Instruction &I, BasicBlock &ExitBlock, PHINode &PN, const LoopInfo *LI,
13691369
const LoopSafetyInfo *SafetyInfo, MemorySSAUpdater *MSSAU) {
13701370
Instruction *New;
@@ -1477,7 +1477,7 @@ static Instruction *sinkThroughTriviallyReplaceablePHI(
14771477
if (It != SunkCopies.end())
14781478
New = It->second;
14791479
else
1480-
New = SunkCopies[ExitBlock] = CloneInstructionInExitBlock(
1480+
New = SunkCopies[ExitBlock] = cloneInstructionInExitBlock(
14811481
*I, *ExitBlock, *TPN, LI, SafetyInfo, MSSAU);
14821482
return New;
14831483
}

llvm/lib/Transforms/Scalar/LoopPredication.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ class LoopPredicationLegacyPass : public LoopPass {
342342
};
343343

344344
char LoopPredicationLegacyPass::ID = 0;
345-
} // end namespace llvm
345+
} // end namespace
346346

347347
INITIALIZE_PASS_BEGIN(LoopPredicationLegacyPass, "loop-predication",
348348
"Loop predication", false, false)

llvm/lib/Transforms/Scalar/LoopRotation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class LoopRotateLegacyPass : public LoopPass {
109109
false, MaxHeaderSize, false);
110110
}
111111
};
112-
}
112+
} // end namespace
113113

114114
char LoopRotateLegacyPass::ID = 0;
115115
INITIALIZE_PASS_BEGIN(LoopRotateLegacyPass, "loop-rotate", "Rotate Loops",

llvm/lib/Transforms/Scalar/LoopSimplifyCFG.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -673,13 +673,13 @@ static bool mergeBlocksIntoPredecessors(Loop &L, DominatorTree &DT,
673673

674674
static bool simplifyLoopCFG(Loop &L, DominatorTree &DT, LoopInfo &LI,
675675
ScalarEvolution &SE, MemorySSAUpdater *MSSAU,
676-
bool &isLoopDeleted) {
676+
bool &IsLoopDeleted) {
677677
bool Changed = false;
678678

679679
// Constant-fold terminators with known constant conditions.
680-
Changed |= constantFoldTerminators(L, DT, LI, SE, MSSAU, isLoopDeleted);
680+
Changed |= constantFoldTerminators(L, DT, LI, SE, MSSAU, IsLoopDeleted);
681681

682-
if (isLoopDeleted)
682+
if (IsLoopDeleted)
683683
return true;
684684

685685
// Eliminate unconditional branches by merging blocks into their predecessors.
@@ -752,7 +752,7 @@ class LoopSimplifyCFGLegacyPass : public LoopPass {
752752
getLoopAnalysisUsage(AU);
753753
}
754754
};
755-
}
755+
} // end namespace
756756

757757
char LoopSimplifyCFGLegacyPass::ID = 0;
758758
INITIALIZE_PASS_BEGIN(LoopSimplifyCFGLegacyPass, "loop-simplifycfg",

llvm/lib/Transforms/Scalar/LoopUnrollAndJamPass.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -91,22 +91,22 @@ static cl::opt<unsigned> PragmaUnrollAndJamThreshold(
9191
// Returns the loop hint metadata node with the given name (for example,
9292
// "llvm.loop.unroll.count"). If no such metadata node exists, then nullptr is
9393
// returned.
94-
static MDNode *GetUnrollMetadataForLoop(const Loop *L, StringRef Name) {
94+
static MDNode *getUnrollMetadataForLoop(const Loop *L, StringRef Name) {
9595
if (MDNode *LoopID = L->getLoopID())
9696
return GetUnrollMetadata(LoopID, Name);
9797
return nullptr;
9898
}
9999

100100
// Returns true if the loop has any metadata starting with Prefix. For example a
101101
// Prefix of "llvm.loop.unroll." returns true if we have any unroll metadata.
102-
static bool HasAnyUnrollPragma(const Loop *L, StringRef Prefix) {
102+
static bool hasAnyUnrollPragma(const Loop *L, StringRef Prefix) {
103103
if (MDNode *LoopID = L->getLoopID()) {
104104
// First operand should refer to the loop id itself.
105105
assert(LoopID->getNumOperands() > 0 && "requires at least one operand");
106106
assert(LoopID->getOperand(0) == LoopID && "invalid loop id");
107107

108-
for (unsigned i = 1, e = LoopID->getNumOperands(); i < e; ++i) {
109-
MDNode *MD = dyn_cast<MDNode>(LoopID->getOperand(i));
108+
for (unsigned I = 1, E = LoopID->getNumOperands(); I < E; ++I) {
109+
MDNode *MD = dyn_cast<MDNode>(LoopID->getOperand(I));
110110
if (!MD)
111111
continue;
112112

@@ -122,14 +122,14 @@ static bool HasAnyUnrollPragma(const Loop *L, StringRef Prefix) {
122122
}
123123

124124
// Returns true if the loop has an unroll_and_jam(enable) pragma.
125-
static bool HasUnrollAndJamEnablePragma(const Loop *L) {
126-
return GetUnrollMetadataForLoop(L, "llvm.loop.unroll_and_jam.enable");
125+
static bool hasUnrollAndJamEnablePragma(const Loop *L) {
126+
return getUnrollMetadataForLoop(L, "llvm.loop.unroll_and_jam.enable");
127127
}
128128

129129
// If loop has an unroll_and_jam_count pragma return the (necessarily
130130
// positive) value from the pragma. Otherwise return 0.
131-
static unsigned UnrollAndJamCountPragmaValue(const Loop *L) {
132-
MDNode *MD = GetUnrollMetadataForLoop(L, "llvm.loop.unroll_and_jam.count");
131+
static unsigned unrollAndJamCountPragmaValue(const Loop *L) {
132+
MDNode *MD = getUnrollMetadataForLoop(L, "llvm.loop.unroll_and_jam.count");
133133
if (MD) {
134134
assert(MD->getNumOperands() == 2 &&
135135
"Unroll count hint metadata should have two operands.");
@@ -190,7 +190,7 @@ static bool computeUnrollAndJamCount(
190190
}
191191

192192
// Check for unroll_and_jam pragmas
193-
unsigned PragmaCount = UnrollAndJamCountPragmaValue(L);
193+
unsigned PragmaCount = unrollAndJamCountPragmaValue(L);
194194
if (PragmaCount > 0) {
195195
UP.Count = PragmaCount;
196196
UP.Runtime = true;
@@ -202,7 +202,7 @@ static bool computeUnrollAndJamCount(
202202
return true;
203203
}
204204

205-
bool PragmaEnableUnroll = HasUnrollAndJamEnablePragma(L);
205+
bool PragmaEnableUnroll = hasUnrollAndJamEnablePragma(L);
206206
bool ExplicitUnrollAndJamCount = PragmaCount > 0 || UserUnrollCount;
207207
bool ExplicitUnrollAndJam = PragmaEnableUnroll || ExplicitUnrollAndJamCount;
208208

@@ -317,8 +317,8 @@ tryToUnrollAndJamLoop(Loop *L, DominatorTree &DT, LoopInfo *LI,
317317
// the unroller, so long as it does not explicitly have unroll_and_jam
318318
// metadata. This means #pragma nounroll will disable unroll and jam as well
319319
// as unrolling
320-
if (HasAnyUnrollPragma(L, "llvm.loop.unroll.") &&
321-
!HasAnyUnrollPragma(L, "llvm.loop.unroll_and_jam.")) {
320+
if (hasAnyUnrollPragma(L, "llvm.loop.unroll.") &&
321+
!hasAnyUnrollPragma(L, "llvm.loop.unroll_and_jam.")) {
322322
LLVM_DEBUG(dbgs() << " Disabled due to pragma.\n");
323323
return LoopUnrollResult::Unmodified;
324324
}

llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -676,32 +676,32 @@ unsigned llvm::ApproximateLoopSize(
676676
// Returns the loop hint metadata node with the given name (for example,
677677
// "llvm.loop.unroll.count"). If no such metadata node exists, then nullptr is
678678
// returned.
679-
static MDNode *GetUnrollMetadataForLoop(const Loop *L, StringRef Name) {
679+
static MDNode *getUnrollMetadataForLoop(const Loop *L, StringRef Name) {
680680
if (MDNode *LoopID = L->getLoopID())
681681
return GetUnrollMetadata(LoopID, Name);
682682
return nullptr;
683683
}
684684

685685
// Returns true if the loop has an unroll(full) pragma.
686-
static bool HasUnrollFullPragma(const Loop *L) {
687-
return GetUnrollMetadataForLoop(L, "llvm.loop.unroll.full");
686+
static bool hasUnrollFullPragma(const Loop *L) {
687+
return getUnrollMetadataForLoop(L, "llvm.loop.unroll.full");
688688
}
689689

690690
// Returns true if the loop has an unroll(enable) pragma. This metadata is used
691691
// for both "#pragma unroll" and "#pragma clang loop unroll(enable)" directives.
692-
static bool HasUnrollEnablePragma(const Loop *L) {
693-
return GetUnrollMetadataForLoop(L, "llvm.loop.unroll.enable");
692+
static bool hasUnrollEnablePragma(const Loop *L) {
693+
return getUnrollMetadataForLoop(L, "llvm.loop.unroll.enable");
694694
}
695695

696696
// Returns true if the loop has an runtime unroll(disable) pragma.
697-
static bool HasRuntimeUnrollDisablePragma(const Loop *L) {
698-
return GetUnrollMetadataForLoop(L, "llvm.loop.unroll.runtime.disable");
697+
static bool hasRuntimeUnrollDisablePragma(const Loop *L) {
698+
return getUnrollMetadataForLoop(L, "llvm.loop.unroll.runtime.disable");
699699
}
700700

701701
// If loop has an unroll_count pragma return the (necessarily
702702
// positive) value from the pragma. Otherwise return 0.
703-
static unsigned UnrollCountPragmaValue(const Loop *L) {
704-
MDNode *MD = GetUnrollMetadataForLoop(L, "llvm.loop.unroll.count");
703+
static unsigned unrollCountPragmaValue(const Loop *L) {
704+
MDNode *MD = getUnrollMetadataForLoop(L, "llvm.loop.unroll.count");
705705
if (MD) {
706706
assert(MD->getNumOperands() == 2 &&
707707
"Unroll count hint metadata should have two operands.");
@@ -765,7 +765,7 @@ bool llvm::computeUnrollCount(
765765
}
766766

767767
// 2nd priority is unroll count set by pragma.
768-
unsigned PragmaCount = UnrollCountPragmaValue(L);
768+
unsigned PragmaCount = unrollCountPragmaValue(L);
769769
if (PragmaCount > 0) {
770770
UP.Count = PragmaCount;
771771
UP.Runtime = true;
@@ -775,14 +775,14 @@ bool llvm::computeUnrollCount(
775775
getUnrolledLoopSize(LoopSize, UP) < PragmaUnrollThreshold)
776776
return true;
777777
}
778-
bool PragmaFullUnroll = HasUnrollFullPragma(L);
778+
bool PragmaFullUnroll = hasUnrollFullPragma(L);
779779
if (PragmaFullUnroll && TripCount != 0) {
780780
UP.Count = TripCount;
781781
if (getUnrolledLoopSize(LoopSize, UP) < PragmaUnrollThreshold)
782782
return false;
783783
}
784784

785-
bool PragmaEnableUnroll = HasUnrollEnablePragma(L);
785+
bool PragmaEnableUnroll = hasUnrollEnablePragma(L);
786786
bool ExplicitUnroll = PragmaCount > 0 || PragmaFullUnroll ||
787787
PragmaEnableUnroll || UserUnrollCount;
788788

@@ -936,7 +936,7 @@ bool llvm::computeUnrollCount(
936936

937937
// 6th priority is runtime unrolling.
938938
// Don't unroll a runtime trip count loop when it is disabled.
939-
if (HasRuntimeUnrollDisablePragma(L)) {
939+
if (hasRuntimeUnrollDisablePragma(L)) {
940940
UP.Count = 0;
941941
return false;
942942
}

0 commit comments

Comments
 (0)