Skip to content

Commit a6edad3

Browse files
committed
[GVN][NFC] Fix some variables as per coding standards
1 parent 5387a77 commit a6edad3

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

llvm/lib/Transforms/Scalar/GVN.cpp

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ uint32_t GVNPass::ValueTable::lookupOrAddCall(CallInst *C) {
547547
const MemoryDependenceResults::NonLocalDepInfo &deps =
548548
MD->getNonLocalCallDependency(C);
549549
// FIXME: Move the checking logic to MemDep!
550-
CallInst* cdep = nullptr;
550+
CallInst *CDep = nullptr;
551551

552552
// Check to see if we have a single dominating call instruction that is
553553
// identical to C.
@@ -557,43 +557,43 @@ uint32_t GVNPass::ValueTable::lookupOrAddCall(CallInst *C) {
557557

558558
// We don't handle non-definitions. If we already have a call, reject
559559
// instruction dependencies.
560-
if (!I.getResult().isDef() || cdep != nullptr) {
561-
cdep = nullptr;
560+
if (!I.getResult().isDef() || CDep != nullptr) {
561+
CDep = nullptr;
562562
break;
563563
}
564564

565565
CallInst *NonLocalDepCall = dyn_cast<CallInst>(I.getResult().getInst());
566566
// FIXME: All duplicated with non-local case.
567567
if (NonLocalDepCall && DT->properlyDominates(I.getBB(), C->getParent())) {
568-
cdep = NonLocalDepCall;
568+
CDep = NonLocalDepCall;
569569
continue;
570570
}
571571

572-
cdep = nullptr;
572+
CDep = nullptr;
573573
break;
574574
}
575575

576-
if (!cdep) {
576+
if (!CDep) {
577577
valueNumbering[C] = nextValueNumber;
578578
return nextValueNumber++;
579579
}
580580

581-
if (cdep->arg_size() != C->arg_size()) {
581+
if (CDep->arg_size() != C->arg_size()) {
582582
valueNumbering[C] = nextValueNumber;
583583
return nextValueNumber++;
584584
}
585585
for (unsigned i = 0, e = C->arg_size(); i < e; ++i) {
586-
uint32_t c_vn = lookupOrAdd(C->getArgOperand(i));
587-
uint32_t cd_vn = lookupOrAdd(cdep->getArgOperand(i));
588-
if (c_vn != cd_vn) {
586+
uint32_t CVN = lookupOrAdd(C->getArgOperand(i));
587+
uint32_t CDepVN = lookupOrAdd(CDep->getArgOperand(i));
588+
if (CVN != CDepVN) {
589589
valueNumbering[C] = nextValueNumber;
590590
return nextValueNumber++;
591591
}
592592
}
593593

594-
uint32_t v = lookupOrAdd(cdep);
595-
valueNumbering[C] = v;
596-
return v;
594+
uint32_t V = lookupOrAdd(CDep);
595+
valueNumbering[C] = V;
596+
return V;
597597
}
598598

599599
valueNumbering[C] = nextValueNumber;
@@ -618,7 +618,7 @@ uint32_t GVNPass::ValueTable::lookupOrAdd(Value *V) {
618618
return nextValueNumber++;
619619
}
620620

621-
Expression exp;
621+
Expression Exp;
622622
switch (I->getOpcode()) {
623623
case Instruction::Call:
624624
return lookupOrAddCall(cast<CallInst>(I));
@@ -662,13 +662,13 @@ uint32_t GVNPass::ValueTable::lookupOrAdd(Value *V) {
662662
case Instruction::InsertElement:
663663
case Instruction::ShuffleVector:
664664
case Instruction::InsertValue:
665-
exp = createExpr(I);
665+
Exp = createExpr(I);
666666
break;
667667
case Instruction::GetElementPtr:
668-
exp = createGEPExpr(cast<GetElementPtrInst>(I));
668+
Exp = createGEPExpr(cast<GetElementPtrInst>(I));
669669
break;
670670
case Instruction::ExtractValue:
671-
exp = createExtractvalueExpr(cast<ExtractValueInst>(I));
671+
Exp = createExtractvalueExpr(cast<ExtractValueInst>(I));
672672
break;
673673
case Instruction::PHI:
674674
valueNumbering[V] = nextValueNumber;
@@ -679,9 +679,9 @@ uint32_t GVNPass::ValueTable::lookupOrAdd(Value *V) {
679679
return nextValueNumber++;
680680
}
681681

682-
uint32_t e = assignExpNewValueNum(exp).first;
683-
valueNumbering[V] = e;
684-
return e;
682+
uint32_t E = assignExpNewValueNum(Exp).first;
683+
valueNumbering[V] = E;
684+
return E;
685685
}
686686

687687
/// Returns the value number of the specified value. Fails if
@@ -2317,15 +2317,15 @@ uint32_t GVNPass::ValueTable::phiTranslateImpl(const BasicBlock *Pred,
23172317
return Num;
23182318
Expression Exp = Expressions[ExprIdx[Num]];
23192319

2320-
for (unsigned i = 0; i < Exp.varargs.size(); i++) {
2320+
for (unsigned I = 0; I < Exp.varargs.size(); I++) {
23212321
// For InsertValue and ExtractValue, some varargs are index numbers
23222322
// instead of value numbers. Those index numbers should not be
23232323
// translated.
2324-
if ((i > 1 && Exp.opcode == Instruction::InsertValue) ||
2325-
(i > 0 && Exp.opcode == Instruction::ExtractValue) ||
2326-
(i > 1 && Exp.opcode == Instruction::ShuffleVector))
2324+
if ((I > 1 && Exp.opcode == Instruction::InsertValue) ||
2325+
(I > 0 && Exp.opcode == Instruction::ExtractValue) ||
2326+
(I > 1 && Exp.opcode == Instruction::ShuffleVector))
23272327
continue;
2328-
Exp.varargs[i] = phiTranslate(Pred, PhiBlock, Exp.varargs[i], Gvn);
2328+
Exp.varargs[I] = phiTranslate(Pred, PhiBlock, Exp.varargs[I], Gvn);
23292329
}
23302330

23312331
if (Exp.commutative) {

0 commit comments

Comments
 (0)