Fix interaction of CFI instructions with MachineOutliner.
authorEli Friedman <efriedma@quicinc.com>
Fri, 10 Jun 2022 20:37:49 +0000 (13:37 -0700)
committerEli Friedman <efriedma@quicinc.com>
Fri, 10 Jun 2022 20:37:49 +0000 (13:37 -0700)
commit0ff51d5dde29dfd9bc5064e32d47345bab7a5034
tree6b903bacab5025406aaad1a4704d40095456cbde
parentfbaa8b9ae5f3c6637be7d4dae6adaab4be811625
Fix interaction of CFI instructions with MachineOutliner.

1. When checking if a candidate contains a CFI instruction, actually
iterate over all of the instructions, instead of stopping halfway
through.
2. Make sure copied CFI directives refer to the correct instruction.

Fixes https://github.com/llvm/llvm-project/issues/55842

Differential Revision: https://reviews.llvm.org/D126930
llvm/lib/CodeGen/MachineOutliner.cpp
llvm/lib/CodeGen/MachineVerifier.cpp
llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
llvm/lib/Target/X86/X86InstrInfo.cpp
llvm/test/CodeGen/AArch64/machine-outliner-cfi.mir