[all-commits] [llvm/llvm-project] 02c845: [RISCV] Teach RISCVMergeBaseOffset to handle read-...

Craig Topper via All-commits all-commits at lists.llvm.org
Tue Jun 28 11:47:38 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 02c8453e64565c2e22879d1a52304a8fb27751e6
      https://github.com/llvm/llvm-project/commit/02c8453e64565c2e22879d1a52304a8fb27751e6
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2022-06-28 (Tue, 28 Jun 2022)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVMergeBaseOffset.cpp
    M llvm/test/CodeGen/RISCV/hoist-global-addr-base.ll

  Log Message:
  -----------
  [RISCV] Teach RISCVMergeBaseOffset to handle read-modify-write of a global.

The pass was previously limited to LUI+ADDI being used by a single
instruction.

This patch allows the pass to optimize multiple memory operations
that use the same offset. Each of them will receive a separate %lo
relocation. My main motivation is to handle a read-modify-write
where we have a load and store to the same address, but I didn't
restrict it to that case.

Reviewed By: asb

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




More information about the All-commits mailing list