forked from OSchip/llvm-project
BasicAAResult::constantOffsetHeuristic - pass APInt arg as const reference. NFCI.
Avoids unnecessary APInt copies and silences clang tidy warning.
This commit is contained in:
parent
97106f9d80
commit
4597bfddf1
|
|
@ -189,7 +189,7 @@ private:
|
||||||
bool
|
bool
|
||||||
constantOffsetHeuristic(const SmallVectorImpl<VariableGEPIndex> &VarIndices,
|
constantOffsetHeuristic(const SmallVectorImpl<VariableGEPIndex> &VarIndices,
|
||||||
LocationSize V1Size, LocationSize V2Size,
|
LocationSize V1Size, LocationSize V2Size,
|
||||||
APInt BaseOffset, AssumptionCache *AC,
|
const APInt &BaseOffset, AssumptionCache *AC,
|
||||||
DominatorTree *DT);
|
DominatorTree *DT);
|
||||||
|
|
||||||
bool isValueEqualInPotentialCycles(const Value *V1, const Value *V2);
|
bool isValueEqualInPotentialCycles(const Value *V1, const Value *V2);
|
||||||
|
|
|
||||||
|
|
@ -433,7 +433,7 @@ static bool isObjectSize(const Value *V, uint64_t Size, const DataLayout &DL,
|
||||||
/// an issue, for example, in particular for 32b pointers with negative indices
|
/// an issue, for example, in particular for 32b pointers with negative indices
|
||||||
/// that rely on two's complement wrap-arounds for precise alias information
|
/// that rely on two's complement wrap-arounds for precise alias information
|
||||||
/// where the maximum pointer size is 64b.
|
/// where the maximum pointer size is 64b.
|
||||||
static APInt adjustToPointerSize(APInt Offset, unsigned PointerSize) {
|
static APInt adjustToPointerSize(const APInt &Offset, unsigned PointerSize) {
|
||||||
assert(PointerSize <= Offset.getBitWidth() && "Invalid PointerSize!");
|
assert(PointerSize <= Offset.getBitWidth() && "Invalid PointerSize!");
|
||||||
unsigned ShiftBits = Offset.getBitWidth() - PointerSize;
|
unsigned ShiftBits = Offset.getBitWidth() - PointerSize;
|
||||||
return (Offset << ShiftBits).ashr(ShiftBits);
|
return (Offset << ShiftBits).ashr(ShiftBits);
|
||||||
|
|
@ -1993,7 +1993,7 @@ void BasicAAResult::GetIndexDifference(
|
||||||
|
|
||||||
bool BasicAAResult::constantOffsetHeuristic(
|
bool BasicAAResult::constantOffsetHeuristic(
|
||||||
const SmallVectorImpl<VariableGEPIndex> &VarIndices,
|
const SmallVectorImpl<VariableGEPIndex> &VarIndices,
|
||||||
LocationSize MaybeV1Size, LocationSize MaybeV2Size, APInt BaseOffset,
|
LocationSize MaybeV1Size, LocationSize MaybeV2Size, const APInt &BaseOffset,
|
||||||
AssumptionCache *AC, DominatorTree *DT) {
|
AssumptionCache *AC, DominatorTree *DT) {
|
||||||
if (VarIndices.size() != 2 || MaybeV1Size == LocationSize::unknown() ||
|
if (VarIndices.size() != 2 || MaybeV1Size == LocationSize::unknown() ||
|
||||||
MaybeV2Size == LocationSize::unknown())
|
MaybeV2Size == LocationSize::unknown())
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue