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

David Green via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 23 13:59:20 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));
----------------
davemgreen wrote:

Hmm. Not that I can seen in TypeSize, I'm afraid. Some places appear to pass MemoryLocation::UnknownSize assuming they are the same size.

I could try and use MemoryLocation::UnknownSize in more places, or try and change it to an optional<> if that is better? That looks like it might be quite a bit of work though

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


More information about the llvm-commits mailing list