[all-commits] [llvm/llvm-project] ad8db9: [RISCV] Eagerly delete instructions in MergeBaseOf...

Craig Topper via All-commits all-commits at lists.llvm.org
Mon Aug 1 09:33:53 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ad8db972b0d5b29ba3e0dc422100f2ca2ac04340
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2022-08-01 (Mon, 01 Aug 2022)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVMergeBaseOffset.cpp

  Log Message:
  [RISCV] Eagerly delete instructions in MergeBaseOffset.

The only iterator we're holding points to HiLUI and we never
delete that so I think it is safe to delete everything else

I want to split detectAndFoldOffset into two phases. First, combine
LUI+ADDI with any ADD/ADDI/SHXADD that comes after it. This may
open opportunities to fold the ADDI from the LUI+ADDI into a
load/store address. So the load/store folding should run as a
second phase even if the ADD/ADDI/SHXADD made changes.

In order to do this we need to eagerly delete instructions in the
first phase so that we don't have dead users of the LUI+ADDI
when we start the second phase.

Patches to split the phases will come later.

Reviewed By: asb, luismarques

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

More information about the All-commits mailing list