[llvm] [SelectionDAG][AMDGPU] Negative offset when selecting scratch sv offsets (PR #122251)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 9 03:07:15 PST 2025


================
@@ -1926,7 +1926,7 @@ bool AMDGPUDAGToDAGISel::checkFlatScratchSVSSwizzleBug(
   KnownBits VKnown = CurDAG->computeKnownBits(VAddr);
   KnownBits SKnown =
       KnownBits::add(CurDAG->computeKnownBits(SAddr),
-                     KnownBits::makeConstant(APInt(32, ImmOffset)));
+                     KnownBits::makeConstant(APSInt(32, ImmOffset)));
----------------
jayfoad wrote:

I'd suggest leaving it as `APInt` but passing `/*isSigned=*/ true` as the third argument.

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


More information about the llvm-commits mailing list