[llvm] [AMDGPU] Fix negative immediate offset for unbuffered smem loads (PR #79553)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 21 16:21:05 PDT 2024
================
@@ -2096,21 +2099,53 @@ bool AMDGPUDAGToDAGISel::SelectSMRDBaseOffset(SDValue Addr, SDValue &SBase,
}
if (!N0 || !N1)
return false;
+
+ bool Selected = false;
if (SelectSMRDOffset(N1, SOffset, Offset, Imm32Only, IsBuffer)) {
SBase = N0;
- return true;
- }
- if (SelectSMRDOffset(N0, SOffset, Offset, Imm32Only, IsBuffer)) {
+ Selected = true;
+ } else if (SelectSMRDOffset(N0, SOffset, Offset, Imm32Only, IsBuffer)) {
SBase = N1;
+ Selected = true;
+ }
+
+ if (Selected) {
----------------
vangthao95 wrote:
I moved this code inside SelectSMRDOffset() where the offset is selected to make it clearer. Although for when sgpr[offset] (SOffset) is present, the offset is selected first before SOffset is selected so I had to adjust it after.
https://github.com/llvm/llvm-project/pull/79553
More information about the llvm-commits
mailing list