[llvm] [Analysis] Add Scalable field in MemoryLocation.h (PR #69716)

Harvin Iriawan via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 23 03:23:44 PDT 2023


================
@@ -64,16 +64,19 @@ class Value;
 //
 // If asked to represent a pathologically large value, this will degrade to
 // std::nullopt.
+// Store Scalable information in bit 62 of Value. Scalable information is
+// required to do Alias Analysis on Scalable quantities
 class LocationSize {
   enum : uint64_t {
     BeforeOrAfterPointer = ~uint64_t(0),
-    AfterPointer = BeforeOrAfterPointer - 1,
-    MapEmpty = BeforeOrAfterPointer - 2,
-    MapTombstone = BeforeOrAfterPointer - 3,
+    ScalableBit = uint64_t(1) << 62,
+    AfterPointer = (BeforeOrAfterPointer - 1) & ~ScalableBit,
+    MapEmpty = (BeforeOrAfterPointer - 2) & ~ScalableBit,
+    MapTombstone = (BeforeOrAfterPointer - 3) & ~ScalableBit,
----------------
harviniriawan wrote:

it seems that it's needed, else some tests like `llvm/test/Analysis/BasicAA/libfuncs.ll` fails

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


More information about the llvm-commits mailing list