[llvm] [LAA] Check if invariant accesses is strictly before other access. (PR #92307)

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Mon May 20 03:15:57 PDT 2024


================
@@ -1991,13 +2015,12 @@ getDependenceDistanceStrideAndSize(
     return MemoryDepChecker::Dependence::Unknown;
   }
 
-  uint64_t TypeByteSize = DL.getTypeAllocSize(ATy);
   bool HasSameSize =
       DL.getTypeStoreSizeInBits(ATy) == DL.getTypeStoreSizeInBits(BTy);
----------------
Meinersbur wrote:

There is a difference now with the handling of scalable types. `getTypeStoreSizeInBits`/`getTypeAllocSize` return the minimum size. Now `TypeByteSize` is 0 if `ATy` is a scalable type (and happens to have the same minimum size as the `TypeStoreSize` of `BTy`), but not if the other way around with `BTy`.

I think it's safer to pass `0` for such cases (minimum size is probably not safe for a scalable type, why wasn't the maximum size used?), so maybe do the same for `BTy`?

https://github.com/llvm/llvm-project/pull/92307


More information about the llvm-commits mailing list