Skip to content

Commit 1d8750c

Browse files
committed
[NFC] Rename GVN -> GVNPass and SROA -> SROAPass
To be more consistent with other pass struct names. There are still more passes that don't end with "Pass", but these are the important ones. Reviewed By: asbirlea Differential Revision: https://reviews.llvm.org/D112935
1 parent a340d47 commit 1d8750c

20 files changed

+189
-182
lines changed

clang/test/CodeGen/thinlto-distributed-newpm.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
; CHECK-O: Running pass: SimplifyCFGPass on main
3434
; CHECK-O: Running analysis: TargetIRAnalysis on main
3535
; CHECK-O: Running analysis: AssumptionAnalysis on main
36-
; CHECK-O: Running pass: SROA on main
36+
; CHECK-O: Running pass: SROAPass on main
3737
; CHECK-O: Running analysis: DominatorTreeAnalysis on main
3838
; CHECK-O: Running pass: EarlyCSEPass on main
3939
; CHECK-O: Running analysis: TargetLibraryAnalysis on main
@@ -68,7 +68,7 @@
6868
; CHECK-O: Invalidating analysis: BasicAA on main
6969
; CHECK-O: Invalidating analysis: AAManager on main
7070
; CHECK-O3: Running pass: ArgumentPromotionPass on (main)
71-
; CHECK-O: Running pass: SROA on main
71+
; CHECK-O: Running pass: SROAPass on main
7272
; These next two can appear in any order since they are accessed as parameters
7373
; on the same call to SROA::runImpl
7474
; CHECK-O-DAG: Running analysis: DominatorTreeAnalysis on main
@@ -96,9 +96,9 @@
9696
; CHECK-O: Running pass: InstCombinePass on main
9797
; CHECK-O: Running pass: LoopSimplifyPass on main
9898
; CHECK-O: Running pass: LCSSAPass on main
99-
; CHECK-O: Running pass: SROA on main
99+
; CHECK-O: Running pass: SROAPass on main
100100
; CHECK-O: Running pass: MergedLoadStoreMotionPass on main
101-
; CHECK-O: Running pass: GVN on main
101+
; CHECK-O: Running pass: GVNPass on main
102102
; CHECK-O: Running pass: SCCPPass on main
103103
; CHECK-O: Running pass: BDCEPass on main
104104
; CHECK-O: Running analysis: DemandedBitsAnalysis on main

llvm/include/llvm/Transforms/Scalar/GVN.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,13 @@ struct GVNOptions {
115115
///
116116
/// FIXME: We should have a good summary of the GVN algorithm implemented by
117117
/// this particular pass here.
118-
class GVN : public PassInfoMixin<GVN> {
118+
class GVNPass : public PassInfoMixin<GVNPass> {
119119
GVNOptions Options;
120120

121121
public:
122122
struct Expression;
123123

124-
GVN(GVNOptions Options = {}) : Options(Options) {}
124+
GVNPass(GVNOptions Options = {}) : Options(Options) {}
125125

126126
/// Run the pass over the function.
127127
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
@@ -182,11 +182,11 @@ class GVN : public PassInfoMixin<GVN> {
182182
Expression createExtractvalueExpr(ExtractValueInst *EI);
183183
uint32_t lookupOrAddCall(CallInst *C);
184184
uint32_t phiTranslateImpl(const BasicBlock *BB, const BasicBlock *PhiBlock,
185-
uint32_t Num, GVN &Gvn);
185+
uint32_t Num, GVNPass &Gvn);
186186
bool areCallValsEqual(uint32_t Num, uint32_t NewNum, const BasicBlock *Pred,
187-
const BasicBlock *PhiBlock, GVN &Gvn);
187+
const BasicBlock *PhiBlock, GVNPass &Gvn);
188188
std::pair<uint32_t, bool> assignExpNewValueNum(Expression &exp);
189-
bool areAllValsInBB(uint32_t num, const BasicBlock *BB, GVN &Gvn);
189+
bool areAllValsInBB(uint32_t num, const BasicBlock *BB, GVNPass &Gvn);
190190

191191
public:
192192
ValueTable();
@@ -200,7 +200,7 @@ class GVN : public PassInfoMixin<GVN> {
200200
uint32_t lookupOrAddCmp(unsigned Opcode, CmpInst::Predicate Pred,
201201
Value *LHS, Value *RHS);
202202
uint32_t phiTranslate(const BasicBlock *BB, const BasicBlock *PhiBlock,
203-
uint32_t Num, GVN &Gvn);
203+
uint32_t Num, GVNPass &Gvn);
204204
void eraseTranslateCacheEntry(uint32_t Num, const BasicBlock &CurrBlock);
205205
bool exists(Value *V) const;
206206
void add(Value *V, uint32_t num);

llvm/include/llvm/Transforms/Scalar/SROA.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class SROALegacyPass;
6262
/// onto insert and extract operations on a vector value, and convert them to
6363
/// this form. By doing so, it will enable promotion of vector aggregates to
6464
/// SSA vector values.
65-
class SROA : public PassInfoMixin<SROA> {
65+
class SROAPass : public PassInfoMixin<SROAPass> {
6666
LLVMContext *C = nullptr;
6767
DominatorTree *DT = nullptr;
6868
AssumptionCache *AC = nullptr;
@@ -110,7 +110,7 @@ class SROA : public PassInfoMixin<SROA> {
110110
SetVector<SelectInst *, SmallVector<SelectInst *, 2>> SpeculatableSelects;
111111

112112
public:
113-
SROA() = default;
113+
SROAPass() = default;
114114

115115
/// Run the pass over the function.
116116
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);

llvm/lib/Passes/PassBuilderPipelines.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ PassBuilder::buildO1FunctionSimplificationPipeline(OptimizationLevel Level,
242242

243243
// Form SSA out of local memory accesses after breaking apart aggregates into
244244
// scalars.
245-
FPM.addPass(SROA());
245+
FPM.addPass(SROAPass());
246246

247247
// Catch trivial redundancies
248248
FPM.addPass(EarlyCSEPass(true /* Enable mem-ssa. */));
@@ -333,7 +333,7 @@ PassBuilder::buildO1FunctionSimplificationPipeline(OptimizationLevel Level,
333333
/*UseBlockFrequencyInfo=*/false));
334334

335335
// Delete small array after loop unroll.
336-
FPM.addPass(SROA());
336+
FPM.addPass(SROAPass());
337337

338338
// Specially optimize memory movement as it doesn't look like dataflow in SSA.
339339
FPM.addPass(MemCpyOptPass());
@@ -383,7 +383,7 @@ PassBuilder::buildFunctionSimplificationPipeline(OptimizationLevel Level,
383383

384384
// Form SSA out of local memory accesses after breaking apart aggregates into
385385
// scalars.
386-
FPM.addPass(SROA());
386+
FPM.addPass(SROAPass());
387387

388388
// Catch trivial redundancies
389389
FPM.addPass(EarlyCSEPass(true /* Enable mem-ssa. */));
@@ -508,7 +508,7 @@ PassBuilder::buildFunctionSimplificationPipeline(OptimizationLevel Level,
508508
/*UseBlockFrequencyInfo=*/false));
509509

510510
// Delete small array after loop unroll.
511-
FPM.addPass(SROA());
511+
FPM.addPass(SROAPass());
512512

513513
// The matrix extension can introduce large vector operations early, which can
514514
// benefit from running vector-combine early on.
@@ -520,7 +520,7 @@ PassBuilder::buildFunctionSimplificationPipeline(OptimizationLevel Level,
520520
if (RunNewGVN)
521521
FPM.addPass(NewGVNPass());
522522
else
523-
FPM.addPass(GVN());
523+
FPM.addPass(GVNPass());
524524

525525
// Sparse conditional constant propagation.
526526
// FIXME: It isn't clear why we do this *after* loop passes rather than
@@ -600,7 +600,7 @@ void PassBuilder::addPGOInstrPasses(ModulePassManager &MPM,
600600
CGSCCPassManager &CGPipeline = MIWP.getPM();
601601

602602
FunctionPassManager FPM;
603-
FPM.addPass(SROA());
603+
FPM.addPass(SROAPass());
604604
FPM.addPass(EarlyCSEPass()); // Catch trivial redundancies.
605605
FPM.addPass(SimplifyCFGPass()); // Merge & remove basic blocks.
606606
FPM.addPass(InstCombinePass()); // Combine silly sequences.
@@ -813,7 +813,7 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level,
813813
// Compare/branch metadata may alter the behavior of passes like SimplifyCFG.
814814
EarlyFPM.addPass(LowerExpectIntrinsicPass());
815815
EarlyFPM.addPass(SimplifyCFGPass());
816-
EarlyFPM.addPass(SROA());
816+
EarlyFPM.addPass(SROAPass());
817817
EarlyFPM.addPass(EarlyCSEPass());
818818
EarlyFPM.addPass(CoroEarlyPass());
819819
if (Level == OptimizationLevel::O3)
@@ -1556,7 +1556,7 @@ PassBuilder::buildLTODefaultPipeline(OptimizationLevel Level,
15561556
}
15571557

15581558
// Break up allocas
1559-
FPM.addPass(SROA());
1559+
FPM.addPass(SROAPass());
15601560

15611561
// LTO provides additional opportunities for tailcall elimination due to
15621562
// link-time inlining, and visibility of nocapture attribute.
@@ -1585,7 +1585,7 @@ PassBuilder::buildLTODefaultPipeline(OptimizationLevel Level,
15851585
if (RunNewGVN)
15861586
MainFPM.addPass(NewGVNPass());
15871587
else
1588-
MainFPM.addPass(GVN());
1588+
MainFPM.addPass(GVNPass());
15891589

15901590
// Remove dead memcpy()'s.
15911591
MainFPM.addPass(MemCpyOptPass());

llvm/lib/Passes/PassRegistry.def

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ FUNCTION_PASS("sink", SinkingPass())
336336
FUNCTION_PASS("slp-vectorizer", SLPVectorizerPass())
337337
FUNCTION_PASS("slsr", StraightLineStrengthReducePass())
338338
FUNCTION_PASS("speculative-execution", SpeculativeExecutionPass())
339-
FUNCTION_PASS("sroa", SROA())
339+
FUNCTION_PASS("sroa", SROAPass())
340340
FUNCTION_PASS("strip-gc-relocates", StripGCRelocates())
341341
FUNCTION_PASS("structurizecfg", StructurizeCFGPass())
342342
FUNCTION_PASS("tailcallelim", TailCallElimPass())
@@ -435,9 +435,9 @@ FUNCTION_PASS_WITH_PARAMS("mldst-motion",
435435
parseMergedLoadStoreMotionOptions,
436436
"no-split-footer-bb;split-footer-bb")
437437
FUNCTION_PASS_WITH_PARAMS("gvn",
438-
"GVN",
438+
"GVNPass",
439439
[](GVNOptions Opts) {
440-
return GVN(Opts);
440+
return GVNPass(Opts);
441441
},
442442
parseGVNOptions,
443443
"no-pre;pre;"

0 commit comments

Comments
 (0)