[llvm] AMDGPU: Only allow 31bit positive offset for scratch (PR #71895)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 9 23:10:11 PST 2023


================
@@ -1859,7 +1859,7 @@ bool AMDGPUDAGToDAGISel::SelectScratchSVAddr(SDNode *N, SDValue Addr,
       std::tie(SplitImmOffset, RemainderOffset)
         = TII->splitFlatOffset(COffsetVal, AMDGPUAS::PRIVATE_ADDRESS, true);
 
-      if (isUInt<32>(RemainderOffset)) {
+      if (RemainderOffset > 0 && isInt<32>(RemainderOffset)) {
----------------
arsenm wrote:

Also needs matching GlobalISel change? Is it testable?

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


More information about the llvm-commits mailing list