[all-commits] [llvm/llvm-project] cefa1c: [AMDGPU] Fix combined MMO in load-store merge

Stanislav Mekhanoshin via All-commits all-commits at lists.llvm.org
Thu Feb 24 10:48:12 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cefa1c5ca93d3a130623a5ccb90216832f3c0a03
      https://github.com/llvm/llvm-project/commit/cefa1c5ca93d3a130623a5ccb90216832f3c0a03
  Author: Stanislav Mekhanoshin <Stanislav.Mekhanoshin at amd.com>
  Date:   2022-02-24 (Thu, 24 Feb 2022)

  Changed paths:
    M llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp
    M llvm/test/CodeGen/AMDGPU/merge-global-load-store.mir
    M llvm/test/CodeGen/AMDGPU/merge-image-load-gfx10.mir
    M llvm/test/CodeGen/AMDGPU/merge-image-load.mir
    M llvm/test/CodeGen/AMDGPU/merge-image-sample-gfx10.mir
    M llvm/test/CodeGen/AMDGPU/merge-image-sample.mir

  Log Message:
  -----------
  [AMDGPU] Fix combined MMO in load-store merge

Loads and stores can be out of order in the SILoadStoreOptimizer.
When combining MachineMemOperands of two instructions operands are
sent in the IR order into the combineKnownAdjacentMMOs. At the
moment it picks the first operand and just replaces its offset and
size. This essentially loses alignment information and may generally
result in an incorrect base pointer to be used.

Use a base pointer in memory addresses order instead and only adjust
size.

Differential Revision: https://reviews.llvm.org/D120370




More information about the All-commits mailing list