diff options
Diffstat (limited to 'llvm/lib/Analysis/LoopAccessAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/LoopAccessAnalysis.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp index eb06fb6..b65db6e 100644 --- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp +++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp @@ -1376,7 +1376,7 @@ llvm::getPtrStride(PredicatedScalarEvolution &PSE, Type *AccessTy, if (isa<ScalableVectorType>(AccessTy)) { LLVM_DEBUG(dbgs() << "LAA: Bad stride - Scalable object: " << *AccessTy << "\n"); - return None; + return std::nullopt; } const SCEV *PtrScev = replaceSymbolicStrideSCEV(PSE, StridesMap, Ptr); @@ -1388,14 +1388,14 @@ llvm::getPtrStride(PredicatedScalarEvolution &PSE, Type *AccessTy, if (!AR) { LLVM_DEBUG(dbgs() << "LAA: Bad stride - Not an AddRecExpr pointer " << *Ptr << " SCEV: " << *PtrScev << "\n"); - return None; + return std::nullopt; } // The access function must stride over the innermost loop. if (Lp != AR->getLoop()) { LLVM_DEBUG(dbgs() << "LAA: Bad stride - Not striding over innermost loop " << *Ptr << " SCEV: " << *AR << "\n"); - return None; + return std::nullopt; } // The address calculation must not wrap. Otherwise, a dependence could be @@ -1423,7 +1423,7 @@ llvm::getPtrStride(PredicatedScalarEvolution &PSE, Type *AccessTy, LLVM_DEBUG( dbgs() << "LAA: Bad stride - Pointer may wrap in the address space " << *Ptr << " SCEV: " << *AR << "\n"); - return None; + return std::nullopt; } } @@ -1435,7 +1435,7 @@ llvm::getPtrStride(PredicatedScalarEvolution &PSE, Type *AccessTy, if (!C) { LLVM_DEBUG(dbgs() << "LAA: Bad stride - Not a constant strided " << *Ptr << " SCEV: " << *AR << "\n"); - return None; + return std::nullopt; } auto &DL = Lp->getHeader()->getModule()->getDataLayout(); @@ -1445,7 +1445,7 @@ llvm::getPtrStride(PredicatedScalarEvolution &PSE, Type *AccessTy, // Huge step value - give up. if (APStepVal.getBitWidth() > 64) - return None; + return std::nullopt; int64_t StepVal = APStepVal.getSExtValue(); @@ -1453,7 +1453,7 @@ llvm::getPtrStride(PredicatedScalarEvolution &PSE, Type *AccessTy, int64_t Stride = StepVal / Size; int64_t Rem = StepVal % Size; if (Rem) - return None; + return std::nullopt; // If the SCEV could wrap but we have an inbounds gep with a unit stride we // know we can't "wrap around the address space". In case of address space @@ -1470,7 +1470,7 @@ llvm::getPtrStride(PredicatedScalarEvolution &PSE, Type *AccessTy, << "LAA: Added an overflow assumption\n"); PSE.setNoOverflow(Ptr, SCEVWrapPredicate::IncrementNUSW); } else - return None; + return std::nullopt; } return Stride; @@ -1492,14 +1492,14 @@ Optional<int> llvm::getPointersDiff(Type *ElemTyA, Value *PtrA, Type *ElemTyB, // Make sure that the element types are the same if required. if (CheckType && ElemTyA != ElemTyB) - return None; + return std::nullopt; unsigned ASA = PtrA->getType()->getPointerAddressSpace(); unsigned ASB = PtrB->getType()->getPointerAddressSpace(); // Check that the address spaces match. if (ASA != ASB) - return None; + return std::nullopt; unsigned IdxWidth = DL.getIndexSizeInBits(ASA); APInt OffsetA(IdxWidth, 0), OffsetB(IdxWidth, 0); @@ -1514,7 +1514,7 @@ Optional<int> llvm::getPointersDiff(Type *ElemTyA, Value *PtrA, Type *ElemTyB, ASB = cast<PointerType>(PtrB1->getType())->getAddressSpace(); // Check that the address spaces match and that the pointers are valid. if (ASA != ASB) - return None; + return std::nullopt; IdxWidth = DL.getIndexSizeInBits(ASA); OffsetA = OffsetA.sextOrTrunc(IdxWidth); @@ -1529,7 +1529,7 @@ Optional<int> llvm::getPointersDiff(Type *ElemTyA, Value *PtrA, Type *ElemTyB, const auto *Diff = dyn_cast<SCEVConstant>(SE.getMinusSCEV(PtrSCEVB, PtrSCEVA)); if (!Diff) - return None; + return std::nullopt; Val = Diff->getAPInt().getSExtValue(); } int Size = DL.getTypeStoreSize(ElemTyA); @@ -1539,7 +1539,7 @@ Optional<int> llvm::getPointersDiff(Type *ElemTyA, Value *PtrA, Type *ElemTyB, // the bitcasts removal in the provided pointers. if (!StrictCheck || Dist * Size == Val) return Dist; - return None; + return std::nullopt; } bool llvm::sortPtrAccesses(ArrayRef<Value *> VL, Type *ElemTy, |