diff --git a/llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp b/llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp index 1d2b1ed3f62693..b69e9f79719b01 100644 --- a/llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp +++ b/llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp @@ -169,7 +169,7 @@ namespace { private: PPCTargetMachine *TM = nullptr; - const PPCSubtarget *ST; + const PPCSubtarget *ST; DominatorTree *DT; LoopInfo *LI; ScalarEvolution *SE; @@ -184,7 +184,7 @@ namespace { bool runOnLoop(Loop *L); /// Check if required PHI node is already exist in Loop \p L. - bool alreadyPrepared(Loop *L, Instruction* MemI, + bool alreadyPrepared(Loop *L, Instruction *MemI, const SCEV *BasePtrStartSCEV, const SCEVConstant *BasePtrIncSCEV, InstrForm Form); @@ -266,7 +266,7 @@ static std::string getInstrName(const Value *I, StringRef Suffix) { if (I->hasName()) return (I->getName() + Suffix).str(); else - return ""; + return ""; } static Value *GetPointerOperand(Value *MemI) { @@ -404,13 +404,13 @@ bool PPCLoopInstrFormPrep::prepareBaseForDispFormChain(Bucket &BucketChain, // contains following load/stores with different remainders: // 1: 10 load/store whose remainder is 1; // 2: 9 load/store whose remainder is 2; - // 3: 1 for remainder 3 and 0 for remainder 0; + // 3: 1 for remainder 3 and 0 for remainder 0; // Now we will choose the first load/store whose remainder is 1 as base and // adjust all other load/stores according to new base, so we will get 10 DS // form and 10 X form. // But we should be more clever, for this case we could use two bases, one for - // remainder 1 and the other for remainder 2, thus we could get 19 DS form and 1 - // X form. + // remainder 1 and the other for remainder 2, thus we could get 19 DS form and + // 1 X form. unsigned MaxCountRemainder = 0; for (unsigned j = 0; j < (unsigned)Form; j++) if ((RemainderOffsetInfo.find(j) != RemainderOffsetInfo.end()) && @@ -673,7 +673,7 @@ bool PPCLoopInstrFormPrep::rewriteLoadStores(Loop *L, Bucket &BucketChain, MadeChange = true; - SuccPrepCount++; + SuccPrepCount++; if (Form == DSForm && !CanPreInc) DSFormChainRewritten++; @@ -730,7 +730,7 @@ bool PPCLoopInstrFormPrep::dispFormPrep(Loop *L, SmallVector &Bucket // This function will check to see if that PHI already exists and will return // true if it found an existing PHI with the matched start and increment as the // one we wanted to create. -bool PPCLoopInstrFormPrep::alreadyPrepared(Loop *L, Instruction* MemI, +bool PPCLoopInstrFormPrep::alreadyPrepared(Loop *L, Instruction *MemI, const SCEV *BasePtrStartSCEV, const SCEVConstant *BasePtrIncSCEV, InstrForm Form) { @@ -777,7 +777,7 @@ bool PPCLoopInstrFormPrep::alreadyPrepared(Loop *L, Instruction* MemI, PHIBasePtrSCEV->getStart() == BasePtrStartSCEV) { ++PHINodeAlreadyExistsUpdate; return true; - } + } if (Form == DSForm || Form == DQForm) { const SCEVConstant *Diff = dyn_cast( SE->getMinusSCEV(PHIBasePtrSCEV->getStart(), BasePtrStartSCEV)); @@ -788,7 +788,7 @@ bool PPCLoopInstrFormPrep::alreadyPrepared(Loop *L, Instruction* MemI, ++PHINodeAlreadyExistsDQ; return true; } - } + } } } } @@ -883,7 +883,8 @@ bool PPCLoopInstrFormPrep::runOnLoop(Loop *L) { return ST && ST->hasP9Vector() && (PointerElementType->isVectorTy()); }; - // intrinsic for update form. + // Collect buckets of comparable addresses used by loads and stores for update + // form. SmallVector UpdateFormBuckets = collectCandidates(L, isUpdateFormCandidate, MaxVarsUpdateForm);