[PATCH] D144957: Fix SGPR + VGPR + offset Scratch offset folding

Petar Avramovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 28 04:44:59 PST 2023


Petar.Avramovic created this revision.
Petar.Avramovic added reviewers: foad, dstuttard, AMDGPU.
Herald added subscribers: kosarev, StephenFan, kerbowa, hiraditya, jvesely, arsenm.
Herald added a project: All.
Petar.Avramovic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Values in SGPR and VGPR register are treated as unsigned by hardware.

When value in 32-bit SGPR or VGPR base can be negative calculate offset
using 32-bit add instructions, otherwise use
sgpr(unsigned) + vgpr(unsigned) + offset.
Does not affect case where whole offset comes from SGPR + VGPR register
(immediate offset is 0).

LoopStrengthReduce.cpp changes offsets to negative and in some
iterations value in SGPR or VGPR register could be negative.


https://reviews.llvm.org/D144957

Files:
  llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
  llvm/test/CodeGen/AMDGPU/flat-scratch-svs.ll
  llvm/test/CodeGen/AMDGPU/flat-scratch.ll
  llvm/test/CodeGen/AMDGPU/memory-legalizer-private-nontemporal.ll
  llvm/test/CodeGen/AMDGPU/memory-legalizer-private-volatile.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144957.501092.patch
Type: text/x-patch
Size: 39454 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230228/b6448f76/attachment.bin>


More information about the llvm-commits mailing list