[llvm] [CodeGen] Update for scalable MemoryType in MMO (PR #70452)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 23 14:06:41 PST 2023


================
@@ -233,13 +239,15 @@ class MachineMemOperand {
   LLT getMemoryType() const { return MemoryType; }
 
   /// Return the size in bytes of the memory reference.
-  uint64_t getSize() const {
-    return MemoryType.isValid() ? MemoryType.getSizeInBytes() : ~UINT64_C(0);
+  TypeSize getSize() const {
+    return MemoryType.isValid() ? MemoryType.getSizeInBytes()
+                                : TypeSize::Fixed(~UINT64_C(0));
   }
 
   /// Return the size in bits of the memory reference.
-  uint64_t getSizeInBits() const {
-    return MemoryType.isValid() ? MemoryType.getSizeInBits() : ~UINT64_C(0);
+  TypeSize getSizeInBits() const {
+    return MemoryType.isValid() ? MemoryType.getSizeInBits()
+                                : TypeSize::Fixed(~UINT64_C(0));
----------------
nikic wrote:

Maybe this should be using LocationSize rather than TypeSize, which can represent an unknown size? I'm not sure to what degree the different cases that LocationSize can represent are relevant at the MI level.

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


More information about the llvm-commits mailing list