[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
Loading
Please sign in to comment