[llvm] [AMDGPU] Fix unaligned SMEM dword immediate offsets (PR #216269)

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 18 00:05:56 PDT 2026


================
@@ -2636,6 +2636,27 @@ bool AMDGPUDAGToDAGISel::SelectSMRDImm(SDValue Addr, SDValue &SBase,
                     &Offset);
 }
 
+bool AMDGPUDAGToDAGISel::SelectSMRDDwordImm(SDValue Addr, SDValue &SBase,
+                                            SDValue &Offset) const {
+  if (!SelectSMRD(/* N */ nullptr, Addr, SBase, /* SOffset */ nullptr,
+                  &Offset))
+    return false;
+
+  // This selector is used for S_LOAD_DWORD* instructions. On GFX11+, their
----------------
YanLiu0942 wrote:

Agreed about the GFX11+ naming. The selector-level change shown here has been removed in the revised patch. The fix is now applied at the widening stage and only prevents a sub-dword load from becoming an S_LOAD_B32 when its constant offset is not dword-aligned.

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


More information about the llvm-commits mailing list