Skip to content

Commit c5f3079

Browse files
author
Dave Abrahams
authored
Merge pull request #5653 from practicalswift/american-english-analysis
[gardening] Use American English: "analyse" → "analyze", "analysing" → "analyzing"
2 parents b67f928 + f328070 commit c5f3079

File tree

10 files changed

+33
-33
lines changed

10 files changed

+33
-33
lines changed

include/swift/SILOptimizer/Analysis/EscapeAnalysis.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -695,14 +695,14 @@ class EscapeAnalysis : public BottomUpIPAnalysis {
695695
void buildConnectionGraph(FunctionInfo *FInfo, FunctionOrder &BottomUpOrder,
696696
int RecursionDepth);
697697

698-
/// Updates the graph by analysing instruction \p I.
698+
/// Updates the graph by analyzing instruction \p I.
699699
/// Visited callees are added to \p BottomUpOrder until \p RecursionDepth
700700
/// reaches MaxRecursionDepth.
701701
void analyzeInstruction(SILInstruction *I, FunctionInfo *FInfo,
702702
FunctionOrder &BottomUpOrder,
703703
int RecursionDepth);
704704

705-
/// Updates the graph by analysing instruction \p SI, which may be a
705+
/// Updates the graph by analyzing instruction \p SI, which may be a
706706
/// select_enum, select_enum_addr or select_value.
707707
template<class SelectInst>
708708
void analyzeSelectInst(SelectInst *SI, ConnectionGraph *ConGraph);

include/swift/SILOptimizer/Utils/PerformanceInlinerUtils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ class ShortestPathAnalysis {
194194
/// Our assumption on how many times a loop is executed.
195195
LoopCount = 10,
196196

197-
/// To keep things simple we only analyse up to this number of nested loops.
197+
/// To keep things simple we only analyze up to this number of nested loops.
198198
MaxNumLoopLevels = 4,
199199

200200
/// The "weight" for the benefit which a single loop nest gives.
@@ -421,4 +421,4 @@ class ShortestPathAnalysis {
421421
Weight getWeight(SILBasicBlock *BB, Weight CallerWeight);
422422

423423
void dump();
424-
};
424+
};

lib/SILOptimizer/LoopTransforms/ArrayBoundsCheckOpts.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ static bool isIdentifiedUnderlyingArrayObject(SILValue V) {
213213
/// eliminate if there exists an earlier bounds check that covers the same
214214
/// index.
215215
///
216-
/// We analyse a region of code for instructions that mayModify the size of an
216+
/// We analyze a region of code for instructions that mayModify the size of an
217217
/// array whenever we encounter an instruction that mayModify a specific array
218218
/// or all arrays we clear the safe arrays (either a specific array or all of
219219
/// them).
@@ -259,19 +259,19 @@ class ABCAnalysis {
259259
/// If an instruction is encountered that might modify any array this method
260260
/// stops further analysis and returns false. Otherwise, true is returned and
261261
/// the safe arrays can be queried.
262-
void analyseBlock(SILBasicBlock *BB) {
262+
void analyzeBlock(SILBasicBlock *BB) {
263263
for (auto &Inst : *BB)
264-
analyseInstruction(&Inst);
264+
analyzeInstruction(&Inst);
265265
}
266266

267267
/// Returns false if the instruction may change the size of any array. All
268268
/// redundant safe array accesses seen up to the instruction can be removed.
269-
void analyse(SILInstruction *I) {
269+
void analyze(SILInstruction *I) {
270270
assert(!LoopMode &&
271271
"This function can only be used in on cfg without loops");
272272
(void)LoopMode;
273273

274-
analyseInstruction(I);
274+
analyzeInstruction(I);
275275
}
276276

277277
/// Returns true if the Array is unsafe.
@@ -288,8 +288,8 @@ class ABCAnalysis {
288288
}
289289

290290
private:
291-
/// Analyse one instruction wrt. the instructions we have seen so far.
292-
void analyseInstruction(SILInstruction *Inst) {
291+
/// Analyze one instruction wrt. the instructions we have seen so far.
292+
void analyzeInstruction(SILInstruction *Inst) {
293293
SILValue Array;
294294
ArrayCallKind K;
295295
auto BoundsEffect =
@@ -357,7 +357,7 @@ static bool removeRedundantChecksInBlock(SILBasicBlock &BB, ArraySet &Arrays,
357357
auto Inst = &*Iter;
358358
++Iter;
359359

360-
ABC.analyse(Inst);
360+
ABC.analyze(Inst);
361361

362362
if (ABC.clearArraysUnsafeFlag()) {
363363
// Any array may be modified -> forget everything. This is just a
@@ -762,7 +762,7 @@ struct InductionInfo {
762762
}
763763
};
764764

765-
/// Analyse canonical induction variables in a loop to find their start and end
765+
/// Analyze canonical induction variables in a loop to find their start and end
766766
/// values.
767767
/// At the moment we only handle very simple induction variables that increment
768768
/// by one and use equality comparison.
@@ -788,7 +788,7 @@ class InductionAnalysis {
788788
InductionAnalysis(const InductionAnalysis &) = delete;
789789
InductionAnalysis &operator=(const InductionAnalysis &) = delete;
790790

791-
bool analyse() {
791+
bool analyze() {
792792
bool FoundIndVar = false;
793793
for (auto *Arg : Header->getBBArgs()) {
794794
// Look for induction variables.
@@ -799,8 +799,8 @@ class InductionAnalysis {
799799
}
800800

801801
InductionInfo *Info;
802-
if (!(Info = analyseIndVar(Arg, IV.Inc, IV.IncVal))) {
803-
DEBUG(llvm::dbgs() << " could not analyse the induction on: " << *Arg);
802+
if (!(Info = analyzeIndVar(Arg, IV.Inc, IV.IncVal))) {
803+
DEBUG(llvm::dbgs() << " could not analyze the induction on: " << *Arg);
804804
continue;
805805
}
806806

@@ -820,8 +820,8 @@ class InductionAnalysis {
820820

821821
private:
822822

823-
/// Analyse one potential induction variable starting at Arg.
824-
InductionInfo *analyseIndVar(SILArgument *HeaderVal, BuiltinInst *Inc,
823+
/// Analyze one potential induction variable starting at Arg.
824+
InductionInfo *analyzeIndVar(SILArgument *HeaderVal, BuiltinInst *Inc,
825825
IntegerLiteralInst *IncVal) {
826826
if (IncVal->getValue() != 1)
827827
return nullptr;
@@ -1129,7 +1129,7 @@ static bool isComparisonKnownFalse(BuiltinInst *Builtin,
11291129
return false;
11301130
}
11311131

1132-
/// Analyse the loop for arrays that are not modified and perform dominator tree
1132+
/// Analyze the loop for arrays that are not modified and perform dominator tree
11331133
/// based redundant bounds check removal.
11341134
static bool hoistBoundsChecks(SILLoop *Loop, DominanceInfo *DT, SILLoopInfo *LI,
11351135
IVInfo &IVs, ArraySet &Arrays,
@@ -1154,7 +1154,7 @@ static bool hoistBoundsChecks(SILLoop *Loop, DominanceInfo *DT, SILLoopInfo *LI,
11541154
// could mutate their size in the loop.
11551155
ABCAnalysis ABC(true, Arrays, RCIA);
11561156
for (auto *BB : Loop->getBlocks()) {
1157-
ABC.analyseBlock(BB);
1157+
ABC.analyzeBlock(BB);
11581158
}
11591159

11601160
// Remove redundant checks down the dominator tree inside the loop,
@@ -1198,7 +1198,7 @@ static bool hoistBoundsChecks(SILLoop *Loop, DominanceInfo *DT, SILLoopInfo *LI,
11981198

11991199
// Find canonical induction variables.
12001200
InductionAnalysis IndVars(DT, IVs, Preheader, Header, ExitingBlk, ExitBlk);
1201-
bool IVarsFound = IndVars.analyse();
1201+
bool IVarsFound = IndVars.analyze();
12021202
if (!IVarsFound) {
12031203
DEBUG(llvm::dbgs() << "No induction variables found\n");
12041204
}

lib/SILOptimizer/LoopTransforms/COWArrayOpt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ class COWArrayOpt {
382382
SmallPtrSet<Operand*, 8> MatchedReleases;
383383

384384
// The address of the array passed to the current make_mutable we are
385-
// analysing.
385+
// analyzing.
386386
SILValue CurrentArrayAddr;
387387
public:
388388
COWArrayOpt(RCIdentityFunctionInfo *RCIA, SILLoop *L,

lib/SILOptimizer/LoopTransforms/LICM.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ bool LoopTreeOptimization::optimize() {
450450
auto CurrLoopSummary = llvm::make_unique<LoopNestSummary>(CurrentLoop);
451451
propagateSummaries(CurrLoopSummary);
452452

453-
// Analyse the current loop for reads that can be hoisted.
453+
// Analyze the current loop for reads that can be hoisted.
454454
ReadSet SafeReads;
455455
analyzeCurrentLoop(CurrLoopSummary, SafeReads);
456456

@@ -475,7 +475,7 @@ void LoopTreeOptimization::analyzeCurrentLoop(
475475
std::unique_ptr<LoopNestSummary> &CurrSummary, ReadSet &SafeReads) {
476476
WriteSet &MayWrites = CurrSummary->MayWrites;
477477
SILLoop *Loop = CurrSummary->Loop;
478-
DEBUG(llvm::dbgs() << " Analysing accesses.\n");
478+
DEBUG(llvm::dbgs() << " Analyzing accesses.\n");
479479

480480
// Contains function calls in the loop, which only read from memory.
481481
SmallVector<ApplyInst *, 8> ReadOnlyApplies;

lib/SILOptimizer/Transforms/ArrayCountPropagation.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class ArrayAllocation {
5959

6060
bool propagate();
6161
bool isInitializationWithKnownCount();
62-
bool analyseArrayValueUses();
62+
bool analyzeArrayValueUses();
6363
bool recursivelyCollectUses(ValueBase *Def);
6464
bool propagateCountToUsers();
6565

@@ -81,7 +81,7 @@ bool ArrayAllocation::propagate() {
8181
return false;
8282

8383
// The array value was stored or has escaped.
84-
if (!analyseArrayValueUses())
84+
if (!analyzeArrayValueUses())
8585
return false;
8686

8787
// No count users.
@@ -113,7 +113,7 @@ bool ArrayAllocation::isInitializationWithKnownCount() {
113113

114114
/// Collect all getCount users and check that there are no escapes or uses that
115115
/// could change the array value.
116-
bool ArrayAllocation::analyseArrayValueUses() {
116+
bool ArrayAllocation::analyzeArrayValueUses() {
117117
return recursivelyCollectUses(ArrayValue);
118118
}
119119

lib/SILOptimizer/Transforms/ArrayElementValuePropagation.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class ArrayAllocation {
6767
bool findValueReplacements();
6868
bool isInitializationWithKnownElements();
6969
bool mapInitializationStores();
70-
bool analyseArrayValueUses();
70+
bool analyzeArrayValueUses();
7171
bool recursivelyCollectUses(ValueBase *Def);
7272
bool collectForwardableValues();
7373

@@ -172,7 +172,7 @@ bool ArrayAllocation::findValueReplacements() {
172172
return false;
173173

174174
// The array value was stored or has escaped.
175-
if (!analyseArrayValueUses())
175+
if (!analyzeArrayValueUses())
176176
return false;
177177

178178
// No count users.
@@ -184,7 +184,7 @@ bool ArrayAllocation::findValueReplacements() {
184184

185185
/// Collect all get_element users and check that there are no escapes or uses
186186
/// that could change the array value.
187-
bool ArrayAllocation::analyseArrayValueUses() {
187+
bool ArrayAllocation::analyzeArrayValueUses() {
188188
return recursivelyCollectUses(ArrayValue);
189189
}
190190

lib/SILOptimizer/Utils/CheckedCastBrJumpThreading.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ bool CheckedCastBrJumpThreading::trySimplify(CheckedCastBranchInst *CCBI) {
632632
/// Optimize the checked_cast_br instructions in a function.
633633
void CheckedCastBrJumpThreading::optimizeFunction() {
634634

635-
// We separate the work in two phases: analyse and transform. This avoids
635+
// We separate the work in two phases: analyze and transform. This avoids
636636
// re-calculating the dominator tree for each optimized checked_cast_br.
637637

638638
// First phase: analysis.

lib/Sema/TypeCheckExpr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212
//
13-
// This file implements semantic analysis for expressions, analysing an
13+
// This file implements semantic analysis for expressions, analyzing an
1414
// expression tree in post-order, bottom-up, from leaves up to the root.
1515
//
1616
//===----------------------------------------------------------------------===//

lib/Sema/TypeCheckPattern.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212
//
13-
// This file implements semantic analysis for patterns, analysing a
13+
// This file implements semantic analysis for patterns, analyzing a
1414
// pattern tree in both bottom-up and top-down ways.
1515
//
1616
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)