@@ -112,8 +112,8 @@ PPCTTIImpl::instCombineIntrinsic(InstCombiner &IC, IntrinsicInst &II) const {
112
112
113
113
// Check that all of the elements are integer constants or undefs.
114
114
bool AllEltsOk = true ;
115
- for (unsigned i = 0 ; i != 16 ; ++i ) {
116
- Constant *Elt = Mask->getAggregateElement (i );
115
+ for (unsigned I = 0 ; I != 16 ; ++I ) {
116
+ Constant *Elt = Mask->getAggregateElement (I );
117
117
if (!Elt || !(isa<ConstantInt>(Elt) || isa<UndefValue>(Elt))) {
118
118
AllEltsOk = false ;
119
119
break ;
@@ -132,11 +132,11 @@ PPCTTIImpl::instCombineIntrinsic(InstCombiner &IC, IntrinsicInst &II) const {
132
132
Value *ExtractedElts[32 ];
133
133
memset (ExtractedElts, 0 , sizeof (ExtractedElts));
134
134
135
- for (unsigned i = 0 ; i != 16 ; ++i ) {
136
- if (isa<UndefValue>(Mask->getAggregateElement (i )))
135
+ for (unsigned I = 0 ; I != 16 ; ++I ) {
136
+ if (isa<UndefValue>(Mask->getAggregateElement (I )))
137
137
continue ;
138
138
unsigned Idx =
139
- cast<ConstantInt>(Mask->getAggregateElement (i ))->getZExtValue ();
139
+ cast<ConstantInt>(Mask->getAggregateElement (I ))->getZExtValue ();
140
140
Idx &= 31 ; // Match the hardware behavior.
141
141
if (DL.isLittleEndian ())
142
142
Idx = 31 - Idx;
@@ -150,7 +150,7 @@ PPCTTIImpl::instCombineIntrinsic(InstCombiner &IC, IntrinsicInst &II) const {
150
150
151
151
// Insert this value into the result vector.
152
152
Result = IC.Builder .CreateInsertElement (Result, ExtractedElts[Idx],
153
- IC.Builder .getInt32 (i ));
153
+ IC.Builder .getInt32 (I ));
154
154
}
155
155
return CastInst::Create (Instruction::BitCast, Result, II.getType ());
156
156
}
@@ -457,16 +457,15 @@ unsigned PPCTTIImpl::getNumberOfRegisters(unsigned ClassID) const {
457
457
unsigned PPCTTIImpl::getRegisterClassForType (bool Vector, Type *Ty) const {
458
458
if (Vector)
459
459
return ST->hasVSX () ? VSXRC : VRRC;
460
- else if (Ty && (Ty-> getScalarType ()-> isFloatTy () ||
461
- Ty->getScalarType ()->isDoubleTy ()))
460
+ if (Ty &&
461
+ (Ty-> getScalarType ()-> isFloatTy () || Ty->getScalarType ()->isDoubleTy ()))
462
462
return ST->hasVSX () ? VSXRC : FPRRC;
463
- else if (Ty && (Ty->getScalarType ()->isFP128Ty () ||
464
- Ty->getScalarType ()->isPPC_FP128Ty ()))
463
+ if (Ty && (Ty->getScalarType ()->isFP128Ty () ||
464
+ Ty->getScalarType ()->isPPC_FP128Ty ()))
465
465
return VRRC;
466
- else if (Ty && Ty->getScalarType ()->isHalfTy ())
466
+ if (Ty && Ty->getScalarType ()->isHalfTy ())
467
467
return VSXRC;
468
- else
469
- return GPRRC;
468
+ return GPRRC;
470
469
}
471
470
472
471
const char * PPCTTIImpl::getRegisterClassName (unsigned ClassID) const {
@@ -694,8 +693,8 @@ InstructionCost PPCTTIImpl::getVectorInstrCost(unsigned Opcode, Type *Val,
694
693
return 0 ;
695
694
696
695
return Cost;
697
-
698
- } else if (Val->getScalarType ()->isIntegerTy ()) {
696
+ }
697
+ if (Val->getScalarType ()->isIntegerTy ()) {
699
698
unsigned EltSize = Val->getScalarSizeInBits ();
700
699
// Computing on 1 bit values requires extra mask or compare operations.
701
700
unsigned MaskCostForOneBitSize = (VecMaskCost && EltSize == 1 ) ? 1 : 0 ;
@@ -709,15 +708,15 @@ InstructionCost PPCTTIImpl::getVectorInstrCost(unsigned Opcode, Type *Val,
709
708
if (ISD == ISD::INSERT_VECTOR_ELT) {
710
709
if (ST->hasP10Vector ())
711
710
return CostFactor + MaskCostForIdx;
712
- else if (Index != -1U )
711
+ if (Index != -1U )
713
712
return 2 * CostFactor;
714
713
} else if (ISD == ISD::EXTRACT_VECTOR_ELT) {
715
714
// It's an extract. Maybe we can do a cheap move-from VSR.
716
715
unsigned EltSize = Val->getScalarSizeInBits ();
717
716
// P9 has both mfvsrd and mfvsrld for 64 bit integer.
718
717
if (EltSize == 64 && Index != -1U )
719
718
return 1 ;
720
- else if (EltSize == 32 ) {
719
+ if (EltSize == 32 ) {
721
720
unsigned MfvsrwzIndex = ST->isLittleEndian () ? 2 : 1 ;
722
721
if (Index == MfvsrwzIndex)
723
722
return 1 ;
@@ -847,9 +846,9 @@ InstructionCost PPCTTIImpl::getMemoryOpCost(unsigned Opcode, Type *Src,
847
846
// stores, loads are expanded using the vector-load + permutation sequence,
848
847
// which is much less expensive).
849
848
if (Src->isVectorTy () && Opcode == Instruction::Store)
850
- for (int i = 0 , e = cast<FixedVectorType>(Src)->getNumElements (); i < e ;
851
- ++i )
852
- Cost += getVectorInstrCost (Instruction::ExtractElement, Src, CostKind, i ,
849
+ for (int I = 0 , E = cast<FixedVectorType>(Src)->getNumElements (); I < E ;
850
+ ++I )
851
+ Cost += getVectorInstrCost (Instruction::ExtractElement, Src, CostKind, I ,
853
852
nullptr , nullptr );
854
853
855
854
return Cost;
@@ -960,8 +959,7 @@ bool PPCTTIImpl::isLSRCostLess(const TargetTransformInfo::LSRCost &C1,
960
959
C1.NumBaseAdds , C1.ScaleCost , C1.ImmCost , C1.SetupCost ) <
961
960
std::tie (C2.Insns , C2.NumRegs , C2.AddRecCost , C2.NumIVMuls ,
962
961
C2.NumBaseAdds , C2.ScaleCost , C2.ImmCost , C2.SetupCost );
963
- else
964
- return TargetTransformInfoImplBase::isLSRCostLess (C1, C2);
962
+ return TargetTransformInfoImplBase::isLSRCostLess (C1, C2);
965
963
}
966
964
967
965
bool PPCTTIImpl::isNumRegsMajorCostOfLSR () {
0 commit comments