[all-commits] [llvm/llvm-project] 241f3e: [DebugInfo][InstrRef] Fix a broken substitution me...

Jeremy Morse via All-commits all-commits at lists.llvm.org
Tue Jul 20 03:45:34 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 241f3e386cd2ce176ac32a957732664ad69b6144
      https://github.com/llvm/llvm-project/commit/241f3e386cd2ce176ac32a957732664ad69b6144
  Author: Jeremy Morse <jeremy.morse at sony.com>
  Date:   2021-07-20 (Tue, 20 Jul 2021)

  Changed paths:
    M llvm/lib/CodeGen/MachineFunction.cpp
    A llvm/test/DebugInfo/MIR/InstrRef/x86-lea-fixup-2.mir
    A llvm/test/DebugInfo/MIR/InstrRef/x86-lea-fixup.mir

  Log Message:
  -----------
  [DebugInfo][InstrRef] Fix a broken substitution method, add test coverage

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

Over in 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 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.

Differential Revision: https://reviews.llvm.org/D105820




More information about the All-commits mailing list