[llvm] LAA: improve code in a couple of routines (NFC) (PR #108092)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 28 03:47:19 PST 2024
================
@@ -2040,19 +2039,16 @@ MemoryDepChecker::isDependent(const MemAccessInfo &A, unsigned AIdx,
*Dist, MaxStride, TypeByteSize))
return Dependence::NoDep;
- const SCEVConstant *C = dyn_cast<SCEVConstant>(Dist);
+ const SCEVConstant *ConstDist = dyn_cast<SCEVConstant>(Dist);
// Attempt to prove strided accesses independent.
- if (C) {
- const APInt &Val = C->getAPInt();
- int64_t Distance = Val.getSExtValue();
+ if (ConstDist) {
+ int64_t Distance = std::abs(ConstDist->getAPInt().getSExtValue());
----------------
fhahn wrote:
Also, if we take the absolute value, clearer to use uint64_t + getZExtValue?
https://github.com/llvm/llvm-project/pull/108092
More information about the llvm-commits
mailing list