[all-commits] [llvm/llvm-project] 526ce9: Propagate tied operands when copying a MachineInstr.

Simon Tatham via All-commits all-commits at lists.llvm.org
Thu Oct 13 01:41:00 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 526ce9c9299ad1f8c2c5971204066dd02e528199
      https://github.com/llvm/llvm-project/commit/526ce9c9299ad1f8c2c5971204066dd02e528199
  Author: Simon Tatham <simon.tatham at arm.com>
  Date:   2022-10-13 (Thu, 13 Oct 2022)

  Changed paths:
    M llvm/lib/CodeGen/MachineInstr.cpp
    M llvm/lib/CodeGen/ModuloSchedule.cpp
    M llvm/test/CodeGen/Thumb2/pipeliner-inlineasm.mir
    M llvm/test/CodeGen/Thumb2/pipeliner-preserve-ties.mir

  Log Message:
  -----------
  Propagate tied operands when copying a MachineInstr.

MachineInstr's copy constructor works by calling the addOperand method
to add each operand of the old MachineInstr to the new one, one by
one. But addOperand deliberately avoids trying to replicate ties
between operands, on the grounds that the tie refers to operands by
index, and the indices aren't necessarily finalized yet.

This led to a code generation fault when the machine pipeliner cloned
an Arm conditional instruction, and lost the tie between the output
register and the input value to be used when the condition failed to
execute.

Reviewed By: dmgreen

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




More information about the All-commits mailing list