@@ -200,12 +200,12 @@ static bool allSameBlock(ArrayRef<Value *> VL) {
200
200
if (!I0)
201
201
return false ;
202
202
BasicBlock *BB = I0->getParent ();
203
- for (int i = 1 , e = VL.size (); i < e; i ++) {
204
- Instruction *I = dyn_cast<Instruction>(VL[i ]);
205
- if (!I )
203
+ for (int I = 1 , E = VL.size (); I < E; I ++) {
204
+ auto *II = dyn_cast<Instruction>(VL[I ]);
205
+ if (!II )
206
206
return false ;
207
207
208
- if (BB != I ->getParent ())
208
+ if (BB != II ->getParent ())
209
209
return false ;
210
210
}
211
211
return true ;
@@ -2692,10 +2692,10 @@ void BoUpSLP::buildTree_rec(ArrayRef<Value *> VL, unsigned Depth,
2692
2692
2693
2693
// Check for terminator values (e.g. invoke).
2694
2694
for (Value *V : VL)
2695
- for (unsigned i = 0 , e = PH->getNumIncomingValues (); i < e ; ++i ) {
2695
+ for (unsigned I = 0 , E = PH->getNumIncomingValues (); I < E ; ++I ) {
2696
2696
Instruction *Term = dyn_cast<Instruction>(
2697
2697
cast<PHINode>(V)->getIncomingValueForBlock (
2698
- PH->getIncomingBlock (i )));
2698
+ PH->getIncomingBlock (I )));
2699
2699
if (Term && Term->isTerminator ()) {
2700
2700
LLVM_DEBUG (dbgs ()
2701
2701
<< " SLP: Need to swizzle PHINodes (terminator use).\n " );
@@ -2712,13 +2712,13 @@ void BoUpSLP::buildTree_rec(ArrayRef<Value *> VL, unsigned Depth,
2712
2712
2713
2713
// Keeps the reordered operands to avoid code duplication.
2714
2714
SmallVector<ValueList, 2 > OperandsVec;
2715
- for (unsigned i = 0 , e = PH->getNumIncomingValues (); i < e ; ++i ) {
2715
+ for (unsigned I = 0 , E = PH->getNumIncomingValues (); I < E ; ++I ) {
2716
2716
ValueList Operands;
2717
2717
// Prepare the operand vector.
2718
2718
for (Value *V : VL)
2719
2719
Operands.push_back (cast<PHINode>(V)->getIncomingValueForBlock (
2720
- PH->getIncomingBlock (i )));
2721
- TE->setOperand (i , Operands);
2720
+ PH->getIncomingBlock (I )));
2721
+ TE->setOperand (I , Operands);
2722
2722
OperandsVec.push_back (Operands);
2723
2723
}
2724
2724
for (unsigned OpIdx = 0 , OpE = OperandsVec.size (); OpIdx != OpE; ++OpIdx)
@@ -3472,31 +3472,31 @@ int BoUpSLP::getEntryCost(TreeEntry *E) {
3472
3472
DeadCost += TTI->getShuffleCost (
3473
3473
TargetTransformInfo::SK_PermuteSingleSrc, VecTy);
3474
3474
}
3475
- for (unsigned i = 0 , e = VL.size (); i < e ; ++i ) {
3476
- Instruction *E = cast<Instruction>(VL[i ]);
3475
+ for (unsigned I = 0 , E = VL.size (); I < E ; ++I ) {
3476
+ Instruction *EI = cast<Instruction>(VL[I ]);
3477
3477
// If all users are going to be vectorized, instruction can be
3478
3478
// considered as dead.
3479
3479
// The same, if have only one user, it will be vectorized for sure.
3480
- if (areAllUsersVectorized (E )) {
3480
+ if (areAllUsersVectorized (EI )) {
3481
3481
// Take credit for instruction that will become dead.
3482
- if (E ->hasOneUse ()) {
3483
- Instruction *Ext = E ->user_back ();
3482
+ if (EI ->hasOneUse ()) {
3483
+ Instruction *Ext = EI ->user_back ();
3484
3484
if ((isa<SExtInst>(Ext) || isa<ZExtInst>(Ext)) &&
3485
3485
all_of (Ext->users (),
3486
3486
[](User *U) { return isa<GetElementPtrInst>(U); })) {
3487
3487
// Use getExtractWithExtendCost() to calculate the cost of
3488
3488
// extractelement/ext pair.
3489
3489
DeadCost -= TTI->getExtractWithExtendCost (
3490
- Ext->getOpcode (), Ext->getType (), VecTy, i );
3490
+ Ext->getOpcode (), Ext->getType (), VecTy, I );
3491
3491
// Add back the cost of s|zext which is subtracted separately.
3492
3492
DeadCost += TTI->getCastInstrCost (
3493
- Ext->getOpcode (), Ext->getType (), E ->getType (),
3493
+ Ext->getOpcode (), Ext->getType (), EI ->getType (),
3494
3494
TTI::getCastContextHint (Ext), CostKind, Ext);
3495
3495
continue ;
3496
3496
}
3497
3497
}
3498
3498
DeadCost -=
3499
- TTI->getVectorInstrCost (Instruction::ExtractElement, VecTy, i );
3499
+ TTI->getVectorInstrCost (Instruction::ExtractElement, VecTy, I );
3500
3500
}
3501
3501
}
3502
3502
return DeadCost;
@@ -4024,9 +4024,9 @@ int BoUpSLP::getGatherCost(FixedVectorType *Ty,
4024
4024
const DenseSet<unsigned > &ShuffledIndices) const {
4025
4025
unsigned NumElts = Ty->getNumElements ();
4026
4026
APInt DemandedElts = APInt::getNullValue (NumElts);
4027
- for (unsigned i = 0 ; i < NumElts; ++i )
4028
- if (!ShuffledIndices.count (i ))
4029
- DemandedElts.setBit (i );
4027
+ for (unsigned I = 0 ; I < NumElts; ++I )
4028
+ if (!ShuffledIndices.count (I ))
4029
+ DemandedElts.setBit (I );
4030
4030
int Cost = TTI->getScalarizationOverhead (Ty, DemandedElts, /* Insert*/ true ,
4031
4031
/* Extract*/ false );
4032
4032
if (!ShuffledIndices.empty ())
@@ -4304,10 +4304,9 @@ Value *BoUpSLP::vectorizeTree(TreeEntry *E) {
4304
4304
return V;
4305
4305
}
4306
4306
case Instruction::ExtractValue: {
4307
- LoadInst *LI = cast<LoadInst>(E->getSingleOperand (0 ));
4307
+ auto *LI = cast<LoadInst>(E->getSingleOperand (0 ));
4308
4308
Builder.SetInsertPoint (LI);
4309
- PointerType *PtrTy =
4310
- PointerType::get (VecTy, LI->getPointerAddressSpace ());
4309
+ auto *PtrTy = PointerType::get (VecTy, LI->getPointerAddressSpace ());
4311
4310
Value *Ptr = Builder.CreateBitCast (LI->getOperand (0 ), PtrTy);
4312
4311
LoadInst *V = Builder.CreateAlignedLoad (VecTy, Ptr, LI->getAlign ());
4313
4312
Value *NewV = propagateMetadata (V, E->Scalars );
0 commit comments