[all-commits] [llvm/llvm-project] a087b7: Wrong debug info generated at -O2 (-O0 is correct)

Vedant Kumar via All-commits all-commits at lists.llvm.org
Thu Nov 7 11:20:10 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: a087b78bc4c31be5a82eda62f1e4c7fe1fec14ad
      https://github.com/llvm/llvm-project/commit/a087b78bc4c31be5a82eda62f1e4c7fe1fec14ad
  Author: Vedant Kumar <vsk at apple.com>
  Date:   2019-11-07 (Thu, 07 Nov 2019)

  Changed paths:
    M llvm/include/llvm/Transforms/Utils/Local.h
    M llvm/lib/Transforms/InstCombine/InstCombineInternal.h
    M llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
    M llvm/lib/Transforms/Utils/Local.cpp
    M llvm/test/Transforms/InstCombine/cast-mul-select.ll
    M llvm/test/Transforms/InstCombine/debuginfo-dce.ll
    A llvm/test/Transforms/InstCombine/pr43893.ll
    M llvm/test/Transforms/InstCombine/stacksave-debuginfo.ll

  Log Message:
  -----------
  Wrong debug info generated at -O2 (-O0 is correct)

Instcombiner pass was erasing trivially dead instruction without updating dependent llvm.dbg.value.
which was not showing programmer current state of variables while debugging.
As a part of this fix I did following,
Iterate throught all the users (llvm.dbg) of a instruction which is trivially dead and set each if them undef, Before deleting the instruction.
Now user will see optimized out, when try to print those variables.
This fixes
https://bugs.llvm.org/show_bug.cgi?id=43893

This is my first fix to llvm.

Patch by kamlesh kumar!

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




More information about the All-commits mailing list