Reapply "[DebugInfo][InstrRef] Instrument x86 CMOV conversion to preserve variable...
authorJeremy Morse <jeremy.morse@sony.com>
Wed, 28 Jun 2023 09:35:57 +0000 (10:35 +0100)
committerOCHyams <orlando.hyams@sony.com>
Wed, 28 Jun 2023 09:37:30 +0000 (10:37 +0100)
commit63565981a2726cc0405e143e7a91d4bcd021f731
tree7752ad93e3b71232745654ab02ca5a3b655609df
parent03adc5f16fddf6410810801af1a67214d31ce8ed
Reapply "[DebugInfo][InstrRef] Instrument x86 CMOV conversion to preserve variable values"

X86's CMOV conversion transforms CMOV instructions into control flow between
blocks, meaning the value is computed by a PHI rather than a "real" machine
instruction. In instruction-referencing mode, we need to transfer the
instruction label between the old CMOV and the new PHI instruction to mark
where the variable value is computed.

There's an extra complication in that memory operands can be unfolded from the
CMOV and sunk into the new blocks -- the test checks both scenarios where the
instruction number has to hop between instructions.

This omission exposed by Dexter testing.

Reviewed By: Orlando

Differential Revision: https://reviews.llvm.org/D145565
llvm/lib/Target/X86/X86CmovConversion.cpp
llvm/test/DebugInfo/MIR/InstrRef/x86-cmov-converter.mir [new file with mode: 0644]