[PATCH] D144956: Fix VGPR + offset Scratch offset folding

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


Petar.Avramovic created this revision.
Petar.Avramovic added reviewers: dstuttard, foad, 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 VGPR register are treated as unsigned by hardware.

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

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


https://reviews.llvm.org/D144956

Files:
  llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
  llvm/test/CodeGen/AMDGPU/chain-hi-to-lo.ll
  llvm/test/CodeGen/AMDGPU/fast-unaligned-load-store.private.ll
  llvm/test/CodeGen/AMDGPU/flat-scratch-svs.ll
  llvm/test/CodeGen/AMDGPU/flat-scratch.ll
  llvm/test/CodeGen/AMDGPU/memory_clause.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144956.501090.patch
Type: text/x-patch
Size: 45810 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230228/9d750097/attachment-0001.bin>


More information about the llvm-commits mailing list