[all-commits] [llvm/llvm-project] 084e41: [RISCV] Fix regression due to interaction of Machi...

Alex Bradbury via All-commits all-commits at lists.llvm.org
Tue Mar 14 10:56:29 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 084e4138930d84b2e76b20c4f36d832abad61696
      https://github.com/llvm/llvm-project/commit/084e4138930d84b2e76b20c4f36d832abad61696
  Author: Alex Bradbury <asb at igalia.com>
  Date:   2023-03-14 (Tue, 14 Mar 2023)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
    M llvm/test/CodeGen/RISCV/O3-pipeline.ll
    M llvm/test/CodeGen/RISCV/machine-outliner-and-machine-copy-propagation.ll

  Log Message:
  -----------
  [RISCV] Fix regression due to interaction of MachineOutliner and MachineCopyPropagation

D144535 enabled machine copy propagation for RISC-V and added it to the
pass pipeline in addPreEmitPass2 (after the MachineOutliner).
Unfortunately, the MachineCopyPropagation pass is unable to correctly
analyse outlined functions, and will delete copy instructions where a
register is set that is intended to be live-out.
RISCVInstrInfo::buildOutlinedFrame will directly insert a JALR, while a
similar function going through the normal codegen path would have a
PseudoRet with operands indicating registers that are live-out.

This patch does the simplest fix, which is to run MachineCopyPropagation
before the MachineOutliner.

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




More information about the All-commits mailing list