diff options
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r-- | llvm/lib/Analysis/DependenceAnalysis.cpp | 32 | ||||
-rw-r--r-- | llvm/lib/Analysis/InstructionSimplify.cpp | 10 | ||||
-rw-r--r-- | llvm/lib/Analysis/TargetLibraryInfo.cpp | 5 |
3 files changed, 22 insertions, 25 deletions
diff --git a/llvm/lib/Analysis/DependenceAnalysis.cpp b/llvm/lib/Analysis/DependenceAnalysis.cpp index 1f0da8d1..8d20b0e 100644 --- a/llvm/lib/Analysis/DependenceAnalysis.cpp +++ b/llvm/lib/Analysis/DependenceAnalysis.cpp @@ -275,7 +275,7 @@ bool Dependence::isAnti() const { // if no subscript in the source or destination mention the induction // variable associated with the loop at this level. // Leave this out of line, so it will serve as a virtual method anchor -bool Dependence::isScalar(unsigned level, bool isSameSD) const { return false; } +bool Dependence::isScalar(unsigned level, bool IsSameSD) const { return false; } //===----------------------------------------------------------------------===// // FullDependence methods @@ -351,38 +351,38 @@ bool FullDependence::normalize(ScalarEvolution *SE) { // getDirection - Returns the direction associated with a particular common or // SameSD level. -unsigned FullDependence::getDirection(unsigned Level, bool isSameSD) const { - return getDVEntry(Level, isSameSD).Direction; +unsigned FullDependence::getDirection(unsigned Level, bool IsSameSD) const { + return getDVEntry(Level, IsSameSD).Direction; } // Returns the distance (or NULL) associated with a particular common or // SameSD level. -const SCEV *FullDependence::getDistance(unsigned Level, bool isSameSD) const { - return getDVEntry(Level, isSameSD).Distance; +const SCEV *FullDependence::getDistance(unsigned Level, bool IsSameSD) const { + return getDVEntry(Level, IsSameSD).Distance; } // Returns true if a particular regular or SameSD level is scalar; that is, // if no subscript in the source or destination mention the induction variable // associated with the loop at this level. -bool FullDependence::isScalar(unsigned Level, bool isSameSD) const { - return getDVEntry(Level, isSameSD).Scalar; +bool FullDependence::isScalar(unsigned Level, bool IsSameSD) const { + return getDVEntry(Level, IsSameSD).Scalar; } // Returns true if peeling the first iteration from this regular or SameSD // loop level will break this dependence. -bool FullDependence::isPeelFirst(unsigned Level, bool isSameSD) const { - return getDVEntry(Level, isSameSD).PeelFirst; +bool FullDependence::isPeelFirst(unsigned Level, bool IsSameSD) const { + return getDVEntry(Level, IsSameSD).PeelFirst; } // Returns true if peeling the last iteration from this regular or SameSD // loop level will break this dependence. -bool FullDependence::isPeelLast(unsigned Level, bool isSameSD) const { - return getDVEntry(Level, isSameSD).PeelLast; +bool FullDependence::isPeelLast(unsigned Level, bool IsSameSD) const { + return getDVEntry(Level, IsSameSD).PeelLast; } // Returns true if splitting loop will break the dependence. -bool FullDependence::isSplitable(unsigned Level, bool isSameSD) const { - return getDVEntry(Level, isSameSD).Splitable; +bool FullDependence::isSplitable(unsigned Level, bool IsSameSD) const { + return getDVEntry(Level, IsSameSD).Splitable; } // inSameSDLoops - Returns true if this level is an SameSD level, i.e., @@ -691,7 +691,7 @@ void Dependence::dump(raw_ostream &OS) const { dumpImp(OS); unsigned SameSDLevels = getSameSDLevels(); if (SameSDLevels > 0) { - OS << "! / assuming " << SameSDLevels << " loop level(s) fused: "; + OS << " / assuming " << SameSDLevels << " loop level(s) fused: "; dumpImp(OS, true); } } @@ -706,13 +706,13 @@ void Dependence::dump(raw_ostream &OS) const { // For debugging purposes. Dumps a dependence to OS with or without considering // the SameSD levels. -void Dependence::dumpImp(raw_ostream &OS, bool isSameSD) const { +void Dependence::dumpImp(raw_ostream &OS, bool IsSameSD) const { bool Splitable = false; unsigned Levels = getLevels(); unsigned SameSDLevels = getSameSDLevels(); bool OnSameSD = false; unsigned LevelNum = Levels; - if (isSameSD) + if (IsSameSD) LevelNum += SameSDLevels; OS << " ["; for (unsigned II = 1; II <= LevelNum; ++II) { diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp index d1977f0..4e38626 100644 --- a/llvm/lib/Analysis/InstructionSimplify.cpp +++ b/llvm/lib/Analysis/InstructionSimplify.cpp @@ -671,12 +671,12 @@ Value *llvm::simplifyAddInst(Value *Op0, Value *Op1, bool IsNSW, bool IsNUW, /// This is very similar to stripAndAccumulateConstantOffsets(), except it /// normalizes the offset bitwidth to the stripped pointer type, not the /// original pointer type. -static APInt stripAndComputeConstantOffsets(const DataLayout &DL, Value *&V, - bool AllowNonInbounds = false) { +static APInt stripAndComputeConstantOffsets(const DataLayout &DL, Value *&V) { assert(V->getType()->isPtrOrPtrVectorTy()); APInt Offset = APInt::getZero(DL.getIndexTypeSizeInBits(V->getType())); - V = V->stripAndAccumulateConstantOffsets(DL, Offset, AllowNonInbounds); + V = V->stripAndAccumulateConstantOffsets(DL, Offset, + /*AllowNonInbounds=*/true); // As that strip may trace through `addrspacecast`, need to sext or trunc // the offset calculated. return Offset.sextOrTrunc(DL.getIndexTypeSizeInBits(V->getType())); @@ -853,10 +853,12 @@ static Value *simplifySubInst(Value *Op0, Value *Op1, bool IsNSW, bool IsNUW, return W; // Variations on GEP(base, I, ...) - GEP(base, i, ...) -> GEP(null, I-i, ...). - if (match(Op0, m_PtrToInt(m_Value(X))) && match(Op1, m_PtrToInt(m_Value(Y)))) + if (match(Op0, m_PtrToIntOrAddr(m_Value(X))) && + match(Op1, m_PtrToIntOrAddr(m_Value(Y)))) { if (Constant *Result = computePointerDifference(Q.DL, X, Y)) return ConstantFoldIntegerCast(Result, Op0->getType(), /*IsSigned*/ true, Q.DL); + } // i1 sub -> xor. if (MaxRecurse && Op0->getType()->isIntOrIntVectorTy(1)) diff --git a/llvm/lib/Analysis/TargetLibraryInfo.cpp b/llvm/lib/Analysis/TargetLibraryInfo.cpp index 6e92766..813632c 100644 --- a/llvm/lib/Analysis/TargetLibraryInfo.cpp +++ b/llvm/lib/Analysis/TargetLibraryInfo.cpp @@ -740,11 +740,6 @@ static void initializeLibCalls(TargetLibraryInfoImpl &TLI, const Triple &T, TLI.setAvailable(LibFunc_fgets_unlocked); } - if (T.isAndroid() && T.isAndroidVersionLT(21)) { - TLI.setUnavailable(LibFunc_stpcpy); - TLI.setUnavailable(LibFunc_stpncpy); - } - if (T.isPS()) { // PS4/PS5 do have memalign. TLI.setAvailable(LibFunc_memalign); |