[all-commits] [llvm/llvm-project] e723e1: [MCP] Handle iterative simplification during forwa...

Philip Reames via All-commits all-commits at lists.llvm.org
Mon Jun 2 11:22:04 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e723e15db1184824eda53184e1fe7fbf54d42763
      https://github.com/llvm/llvm-project/commit/e723e15db1184824eda53184e1fe7fbf54d42763
  Author: Philip Reames <preames at rivosinc.com>
  Date:   2025-06-02 (Mon, 02 Jun 2025)

  Changed paths:
    M llvm/lib/CodeGen/MachineCopyPropagation.cpp
    M llvm/test/CodeGen/RISCV/GlobalISel/constbarrier-rv32.ll
    M llvm/test/CodeGen/RISCV/GlobalISel/constbarrier-rv64.ll
    M llvm/test/CodeGen/RISCV/GlobalISel/div-by-constant.ll
    M llvm/test/CodeGen/RISCV/GlobalISel/rv32zbb.ll
    M llvm/test/CodeGen/RISCV/machine-copyprop-simplifyinstruction.mir

  Log Message:
  -----------
  [MCP] Handle iterative simplification during forward copy prop (#140267)

This is the follow up I mentioned doing in the review of 52b345d. That
change introduced an API for performing instruction simplifications
following copy propagation (e.g. things like recognizing ORI a0, a1,
zero is just a move). As noted in that review, we should be able to
perform iterative simplification as we move forward through the block,
but weren't because of the code structure.

The majority of this code is just deleting the special casing for
constant source and destination tracking, and merging the copy handling
with the main path. By assumption, the properties of copies (in terms of
register reads and writes), must be a subset of general instructions.

Once we do that, the iterative bit basically falls out from having the
tracking performed for copies which are recognized *after* we forward
prior uses.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list