[llvm] [AMDGPU] Folding imm offset in more cases for scratch access (PR #70634)

via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 31 07:37:16 PDT 2023


================
@@ -1886,7 +1899,8 @@ bool AMDGPUDAGToDAGISel::SelectScratchSVAddr(SDNode *N, SDValue Addr,
     return false;
   }
 
-  if (!isFlatScratchBaseLegal(SAddr) || !isFlatScratchBaseLegal(VAddr))
+  if (!isFlatScratchBaseLegal(Addr, SAddr) ||
----------------
ruiling wrote:

I think it is still helpful to consolidate this kind of legal check into one place for future possible hardware change. I have made the helper function accept two `bases` to cover the `SGPR+VGPR+Imm` case.

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


More information about the llvm-commits mailing list