@@ -157,14 +157,14 @@ class GVNPass : public PassInfoMixin<GVNPass> {
157
157
// / as an efficient mechanism to determine the expression-wise equivalence of
158
158
// / two values.
159
159
class ValueTable {
160
- DenseMap<Value *, uint32_t > valueNumbering ;
161
- DenseMap<Expression, uint32_t > expressionNumbering ;
160
+ DenseMap<Value *, uint32_t > ValueNumbering ;
161
+ DenseMap<Expression, uint32_t > ExpressionNumbering ;
162
162
163
163
// Expressions is the vector of Expression. ExprIdx is the mapping from
164
164
// value number to the index of Expression in Expressions. We use it
165
165
// instead of a DenseMap because filling such mapping is faster than
166
166
// filling a DenseMap and the compile time is a little better.
167
- uint32_t nextExprNumber = 0 ;
167
+ uint32_t NextExprNumber = 0 ;
168
168
169
169
std::vector<Expression> Expressions;
170
170
std::vector<uint32_t > ExprIdx;
@@ -181,7 +181,7 @@ class GVNPass : public PassInfoMixin<GVNPass> {
181
181
MemoryDependenceResults *MD = nullptr ;
182
182
DominatorTree *DT = nullptr ;
183
183
184
- uint32_t nextValueNumber = 1 ;
184
+ uint32_t NextValueNumber = 1 ;
185
185
186
186
Expression createExpr (Instruction *I);
187
187
Expression createCmpExpr (unsigned Opcode, CmpInst::Predicate Predicate,
@@ -190,11 +190,11 @@ class GVNPass : public PassInfoMixin<GVNPass> {
190
190
Expression createGEPExpr (GetElementPtrInst *GEP);
191
191
uint32_t lookupOrAddCall (CallInst *C);
192
192
uint32_t phiTranslateImpl (const BasicBlock *BB, const BasicBlock *PhiBlock,
193
- uint32_t Num, GVNPass &Gvn );
193
+ uint32_t Num, GVNPass &GVN );
194
194
bool areCallValsEqual (uint32_t Num, uint32_t NewNum, const BasicBlock *Pred,
195
- const BasicBlock *PhiBlock, GVNPass &Gvn );
196
- std::pair<uint32_t , bool > assignExpNewValueNum (Expression &exp );
197
- bool areAllValsInBB (uint32_t num , const BasicBlock *BB, GVNPass &Gvn );
195
+ const BasicBlock *PhiBlock, GVNPass &GVN );
196
+ std::pair<uint32_t , bool > assignExpNewValueNum (Expression &Exp );
197
+ bool areAllValsInBB (uint32_t Num , const BasicBlock *BB, GVNPass &GVN );
198
198
199
199
public:
200
200
ValueTable ();
@@ -208,17 +208,17 @@ class GVNPass : public PassInfoMixin<GVNPass> {
208
208
uint32_t lookupOrAddCmp (unsigned Opcode, CmpInst::Predicate Pred,
209
209
Value *LHS, Value *RHS);
210
210
uint32_t phiTranslate (const BasicBlock *BB, const BasicBlock *PhiBlock,
211
- uint32_t Num, GVNPass &Gvn );
211
+ uint32_t Num, GVNPass &GVN );
212
212
void eraseTranslateCacheEntry (uint32_t Num, const BasicBlock &CurrBlock);
213
213
bool exists (Value *V) const ;
214
- void add (Value *V, uint32_t num );
214
+ void add (Value *V, uint32_t Num );
215
215
void clear ();
216
- void erase (Value *v );
216
+ void erase (Value *V );
217
217
void setAliasAnalysis (AAResults *A) { AA = A; }
218
218
AAResults *getAliasAnalysis () const { return AA; }
219
219
void setMemDep (MemoryDependenceResults *M) { MD = M; }
220
220
void setDomTree (DominatorTree *D) { DT = D; }
221
- uint32_t getNextUnusedValueNumber () { return nextValueNumber ; }
221
+ uint32_t getNextUnusedValueNumber () { return NextValueNumber ; }
222
222
void verifyRemoved (const Value *) const ;
223
223
};
224
224
@@ -327,9 +327,9 @@ class GVNPass : public PassInfoMixin<GVNPass> {
327
327
OptimizationRemarkEmitter *ORE, MemorySSA *MSSA = nullptr );
328
328
329
329
// List of critical edges to be split between iterations.
330
- SmallVector<std::pair<Instruction *, unsigned >, 4 > toSplit ;
330
+ SmallVector<std::pair<Instruction *, unsigned >, 4 > ToSplit ;
331
331
332
- // Helper functions of redundant load elimination
332
+ // Helper functions of redundant load elimination.
333
333
bool processLoad (LoadInst *L);
334
334
bool processNonLocalLoad (LoadInst *L);
335
335
bool processAssumeIntrinsic (AssumeInst *II);
@@ -367,16 +367,16 @@ class GVNPass : public PassInfoMixin<GVNPass> {
367
367
MapVector<BasicBlock *, Value *> &AvailableLoads,
368
368
MapVector<BasicBlock *, LoadInst *> *CriticalEdgePredAndLoad);
369
369
370
- // Other helper routines
370
+ // Other helper routines.
371
371
bool processInstruction (Instruction *I);
372
372
bool processBlock (BasicBlock *BB);
373
- void dump (DenseMap<uint32_t , Value *> &d ) const ;
373
+ void dump (DenseMap<uint32_t , Value *> &Map ) const ;
374
374
bool iterateOnFunction (Function &F);
375
375
bool performPRE (Function &F);
376
376
bool performScalarPRE (Instruction *I);
377
377
bool performScalarPREInsertion (Instruction *Instr, BasicBlock *Pred,
378
378
BasicBlock *Curr, unsigned int ValNo);
379
- Value *findLeader (const BasicBlock *BB, uint32_t num );
379
+ Value *findLeader (const BasicBlock *BB, uint32_t Num );
380
380
void cleanupGlobalSets ();
381
381
void removeInstruction (Instruction *I);
382
382
void verifyRemoved (const Instruction *I) const ;
0 commit comments