@@ -85,9 +85,10 @@ static cl::opt<unsigned>
8585 " when sorting profitable allocas" ),
8686 cl::init(4 ));
8787
88- static cl::opt<unsigned > DynIdxNumElmLimit (" dynamic-index-num-element-limit" ,
88+ static cl::opt<unsigned > DynIdxNumElmLimit (
89+ " dynamic-index-num-element-limit" ,
8990 cl::desc (" Maximum number of elements for promoting alloca with dynamic"
90- " index" ),
91+ " index" ),
9192 cl::init(8 ));
9293
9394// Shared implementation which can do both promotion to vector and to LDS.
@@ -924,20 +925,20 @@ bool AMDGPUPromoteAllocaImpl::tryPromoteAllocaToVector(AllocaInst &Alloca) {
924925 Value *Index = GEPToVectorIndex (GEP, &Alloca, VecEltTy, *DL, NewGEPInsts);
925926 if (!Index)
926927 return RejectUser (Inst, " cannot compute vector index for GEP" );
927-
928+
928929 if (!isa<ConstantInt>(Index)) {
929930 bool UsedInLoad = false ;
930931 for (auto *U : GEP->users ()) {
931- if (isa<LoadInst>(U)) {
932+ if (isa<LoadInst>(U)) {
932933 UsedInLoad = true ;
933934 break ;
934935 }
935936 }
936- if (auto *UserVecTy = dyn_cast<FixedVectorType>(
937- GEP->getSourceElementType ())) {
937+ if (auto *UserVecTy =
938+ dyn_cast<FixedVectorType>( GEP->getSourceElementType ())) {
938939 if (UsedInLoad && UserVecTy->getNumElements () > DynIdxNumElmLimit) {
939- return RejectUser (Inst,
940- " user has too many elements for dynamic index" );
940+ return RejectUser (Inst,
941+ " user has too many elements for dynamic index" );
941942 }
942943 }
943944 }
0 commit comments