This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo][InstrRef] Don't create duplicate instruction numbers in X86-fixup-LEAs
ClosedPublic

Authored by jmorse on Feb 8 2022, 4:16 AM.

Details

Summary

Over in D104684 we ended up creating duplicate instruction numbers for instruction-referencing mode (root cause: I haven't landed the docs in D113586). A new pattern for optimising LEAs is added, and the instruction number for the computed value is attached to two instructions, not one. This then causes an assertion to fire in EXPENSIVE_CHECKS mode as reported by @uabelho in [0]. This patch removes the duplicate instruction number and adds a test.

Without EXPENSIVE_CHECKs, the net effect is that the developer will be presented with the wrong variable location, so this shouldn't be crashing anywhere else. However, that's a good argument for adding more instr-ref checks to MachineVerifier.

(This patch also modifies a COREI7-LABEL line that looks like it was typo'd when I originally landed the test, ooof. It doesn't affect test coverage until this patch though).

[0] https://github.com/llvm/llvm-project/commit/6e03a68b776dc06826dacbdab26d24a90bb2173b#commitcomment-66240657

Diff Detail

Event Timeline

jmorse created this revision.Feb 8 2022, 4:16 AM
jmorse requested review of this revision.Feb 8 2022, 4:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 8 2022, 4:16 AM
StephenTozer accepted this revision.Feb 9 2022, 2:55 AM

Simple fix LGTM.

llvm/test/DebugInfo/MIR/InstrRef/x86-lea-fixup.mir
12

Nice drive-by fix.

This revision is now accepted and ready to land.Feb 9 2022, 2:55 AM
This revision was landed with ongoing or failed builds.Feb 10 2022, 8:37 AM
This revision was automatically updated to reflect the committed changes.