This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo][InstrRef] Instrument x86 CMOV conversion to preserve variable values
ClosedPublic

Authored by jmorse on Mar 8 2023, 3:01 AM.

Details

Summary

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 :O !

Diff Detail

Event Timeline

jmorse created this revision.Mar 8 2023, 3:01 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 8 2023, 3:01 AM
jmorse requested review of this revision.Mar 8 2023, 3:01 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 8 2023, 3:01 AM
Orlando accepted this revision.Mar 8 2023, 5:02 AM

Nice! LGTM with nit / question inline.

llvm/test/DebugInfo/MIR/InstrRef/x86-cmov-converter.mir
9

Do these CHECK lines cover both functions / part of the test? IMO it's not entirely clear. Maybe it's worth adding another CHECK-LABEL to improve clarity?

This revision is now accepted and ready to land.Mar 8 2023, 5:02 AM
Orlando added a comment.EditedJun 28 2023, 1:18 AM

The verifier issue should be fixed in D153950. Slightly surprised that this test is the first to find the issue... grepping for x86-cmov-conversion in llvm/test only shows this new test.