[llvm] [LAA] Switch safe-distance APIs to operate in elements instead of bits, NFCI'ish (PR #191867)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 7 01:34:20 PDT 2026


================
@@ -224,19 +224,16 @@ class MemoryDepChecker {
   /// Return true if the number of elements that are safe to operate on
   /// simultaneously is not bounded.
   bool isSafeForAnyVectorWidth() const {
-    return MaxSafeVectorWidthInBits == UINT_MAX;
+    return MaxSafeNumElements == UINT_MAX;
   }
 
   /// Return the number of elements that are safe to operate on
-  /// simultaneously, multiplied by the size of the element in bits.
-  uint64_t getMaxSafeVectorWidthInBits() const {
-    return MaxSafeVectorWidthInBits;
-  }
+  /// simultaneously.
+  uint64_t getMaxSafeNumElements() const { return MaxSafeNumElements; }
----------------
david-arm wrote:

I agree it cannot happen in current hardware, but I'm still concerned about making assumptions because from an IR perspective it can happen. FYI: @fhahn has been doing work in this area adding tests with very large vscale ranges, e.g. see https://github.com/llvm/llvm-project/pull/221219.

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


More information about the llvm-commits mailing list