[PATCH] D105820: [DebugInfo][InstrRef] Fix a broken substitution method, add test coverage

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 12 08:32:36 PDT 2021


jmorse created this revision.
jmorse added a reviewer: debug-info.
Herald added subscribers: pengfei, hiraditya.
jmorse requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This patch fixes a clearly-broken function that I absent-mindedly bodged many months ago.

Over in D85749 <https://reviews.llvm.org/D85749> I landed the substituteDebugValuesForInst, that creates substitution records for all the def operands from one debug-labelled instruction to the new one. Unfortunately it would crash if the two instructions had different numbers of operands; I tried to fix this in 537f0fbe82 <https://reviews.llvm.org/rG537f0fbe82049b8d5b6c700ecc4ab166c350b0c6> by adding a "max operand" parameter to the method, but then didn't actually change the loop bound to take account of this. It passed all the tests because.... well there wasn't any real test coverage of this method.

This patch fixes up the loop to be bounded by the MaxOperand bound; and adds test coverage for the x86-fixup-LEAs calls to this method, so that it's actually tested.

Ooops.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D105820

Files:
  llvm/lib/CodeGen/MachineFunction.cpp
  llvm/test/DebugInfo/MIR/InstrRef/x86-lea-fixup-2.mir
  llvm/test/DebugInfo/MIR/InstrRef/x86-lea-fixup.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105820.357952.patch
Type: text/x-patch
Size: 5799 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210712/da50b247/attachment.bin>


More information about the llvm-commits mailing list