[AMDGPU] Better selection of base offset when merging DS reads/writes
authorJay Foad <jay.foad@amd.com>
Tue, 9 Feb 2021 18:11:10 +0000 (18:11 +0000)
committerJay Foad <jay.foad@amd.com>
Thu, 11 Feb 2021 17:46:09 +0000 (17:46 +0000)
commit23db2d363fd3fe851197fc314f0150976e31be5e
tree9079d544cb22a7fbebc24f4d841d1d650f59f13e
parent5744502a137cbc9f2732e707fde984399b241515
[AMDGPU] Better selection of base offset when merging DS reads/writes

When merging a pair of DS reads or writes needs to materialize the base
offset in a vgpr, choose a value that is aligned to as high a power of
two as possible. This maximises the chance that different pairs can use
the same base offset, in which case the base offset registers can be
commoned up by MachineCSE.

Differential Revision: https://reviews.llvm.org/D96421
llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp
llvm/test/CodeGen/AMDGPU/ds-combine-large-stride.ll
llvm/test/CodeGen/AMDGPU/fence-lds-read2-write2.ll
llvm/test/CodeGen/AMDGPU/merge-load-store-vreg.mir