[llvm] [GlobalISel] Use LocationSize in GISelAddressing. NFC (PR #83885)

Amara Emerson via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 4 21:40:23 PST 2024


================
@@ -117,8 +117,12 @@ bool GISelAddressing::aliasIsKnownForLoadStore(const MachineInstr &MI1,
   if (!BasePtr0.BaseReg.isValid() || !BasePtr1.BaseReg.isValid())
     return false;
 
-  int64_t Size1 = LdSt1->getMemSize();
-  int64_t Size2 = LdSt2->getMemSize();
+  LocationSize Size1 = LdSt1->getMemSize() != MemoryLocation::UnknownSize
+                           ? LdSt1->getMemSize()
+                           : LocationSize::beforeOrAfterPointer();
+  LocationSize Size2 = LdSt2->getMemSize() != MemoryLocation::UnknownSize
+                           ? LdSt2->getMemSize()
+                           : LocationSize::beforeOrAfterPointer();
----------------
aemerson wrote:

How about we add helpers to `GLoadStore` like `getMemLocationSize()`. I find having to compare against this awkwardly named `beforeOrAfterPointer()` thing cumbersome.

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


More information about the llvm-commits mailing list