[llvm] [AMDGPU] Disallow negative s_load offsets in isLegalAddressingMode (PR #91327)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue May 7 07:49:16 PDT 2024


================
@@ -1604,6 +1604,14 @@ bool SITargetLowering::isLegalAddressingMode(const DataLayout &DL,
         return false;
     }
 
+    if (AS == AMDGPUAS::CONSTANT_ADDRESS && AM.BaseOffs < 0) {
----------------
arsenm wrote:

It's a CONSTANT_ADDRESS truncated to the low 32-bits, where the high bits are assumed a constant from an attribute. The addressing modes should behave the same as constant, it's just implicitly promoted to the 64-bit pointer when codegenned 

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


More information about the llvm-commits mailing list