1. Wrong debug info generated at -O2 (-O0 is correct) (details)
Commit a087b78bc4c31be5a82eda62f1e4c7fe1fec14ad by Vedant Kumar
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
This is my first fix to llvm.
Patch by kamlesh kumar!
Differential Revision:
The file was modifiedllvm/lib/Transforms/InstCombine/InstructionCombining.cpp
The file was addedllvm/test/Transforms/InstCombine/pr43893.ll
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineInternal.h
The file was modifiedllvm/include/llvm/Transforms/Utils/Local.h
The file was modifiedllvm/test/Transforms/InstCombine/cast-mul-select.ll
The file was modifiedllvm/test/Transforms/InstCombine/debuginfo-dce.ll
The file was modifiedllvm/test/Transforms/InstCombine/stacksave-debuginfo.ll
The file was modifiedllvm/lib/Transforms/Utils/Local.cpp