Instruction *TheStore,
SmallPtrSetImpl<Instruction *> &Stores,
const SCEVAddRecExpr *Ev, const SCEV *BECount,
- bool NegStride, bool IsLoopMemset = false);
+ bool IsNegStride, bool IsLoopMemset = false);
bool processLoopStoreOfLoopLoad(StoreInst *SI, const SCEV *BECount);
bool processLoopStoreOfLoopLoad(Value *DestPtr, Value *SourcePtr,
unsigned StoreSize, MaybeAlign StoreAlign,
if (StoreSize != Stride && StoreSize != -Stride)
continue;
- bool NegStride = StoreSize == -Stride;
+ bool IsNegStride = StoreSize == -Stride;
const SCEV *StoreSizeSCEV = SE->getConstant(BECount->getType(), StoreSize);
if (processLoopStridedStore(StorePtr, StoreSizeSCEV,
MaybeAlign(HeadStore->getAlignment()),
StoredVal, HeadStore, AdjacentStores, StoreEv,
- BECount, NegStride)) {
+ BECount, IsNegStride)) {
TransformedStores.insert(AdjacentStores.begin(), AdjacentStores.end());
Changed = true;
}
SmallPtrSet<Instruction *, 1> MSIs;
MSIs.insert(MSI);
- bool NegStride = SizeInBytes == -Stride;
+ bool IsNegStride = SizeInBytes == -Stride;
return processLoopStridedStore(Pointer, SE->getSCEV(MSI->getLength()),
MaybeAlign(MSI->getDestAlignment()),
- SplatValue, MSI, MSIs, Ev, BECount, NegStride,
- /*IsLoopMemset=*/true);
+ SplatValue, MSI, MSIs, Ev, BECount,
+ IsNegStride, /*IsLoopMemset=*/true);
}
/// mayLoopAccessLocation - Return true if the specified loop might access the
Value *DestPtr, const SCEV *StoreSizeSCEV, MaybeAlign StoreAlignment,
Value *StoredVal, Instruction *TheStore,
SmallPtrSetImpl<Instruction *> &Stores, const SCEVAddRecExpr *Ev,
- const SCEV *BECount, bool NegStride, bool IsLoopMemset) {
+ const SCEV *BECount, bool IsNegStride, bool IsLoopMemset) {
Value *SplatValue = isBytewiseValue(StoredVal, *DL);
Constant *PatternValue = nullptr;
bool Changed = false;
const SCEV *Start = Ev->getStart();
// Handle negative strided loops.
- if (NegStride)
+ if (IsNegStride)
Start = getStartForNegStride(Start, BECount, IntIdxTy, StoreSizeSCEV, SE);
// TODO: ideally we should still be able to generate memset if SCEV expander
Type *IntIdxTy = Builder.getIntNTy(DL->getIndexSizeInBits(StrAS));
APInt Stride = getStoreStride(StoreEv);
- bool NegStride = StoreSize == -Stride;
+ bool IsNegStride = StoreSize == -Stride;
const SCEV *StoreSizeSCEV = SE->getConstant(BECount->getType(), StoreSize);
// Handle negative strided loops.
- if (NegStride)
+ if (IsNegStride)
StrStart =
getStartForNegStride(StrStart, BECount, IntIdxTy, StoreSizeSCEV, SE);
unsigned LdAS = SourcePtr->getType()->getPointerAddressSpace();
// Handle negative strided loops.
- if (NegStride)
+ if (IsNegStride)
LdStart =
getStartForNegStride(LdStart, BECount, IntIdxTy, StoreSizeSCEV, SE);
DL->getTypeSizeInBits(TheLoad->getType()).getFixedSize() / 8;
if (BP1 != BP2 || LoadSize != int64_t(StoreSize))
return Changed;
- if ((!NegStride && LoadOff < StoreOff + int64_t(StoreSize)) ||
- (NegStride && LoadOff + LoadSize > StoreOff))
+ if ((!IsNegStride && LoadOff < StoreOff + int64_t(StoreSize)) ||
+ (IsNegStride && LoadOff + LoadSize > StoreOff))
return Changed;
}