[llvm-bugs] [Bug 41475] New: [DebugInfo at O2] InstCombine drops value of a boolean argument

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Apr 11 16:22:10 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=41475

            Bug ID: 41475
           Summary: [DebugInfo at O2] InstCombine drops value of a boolean
                    argument
           Product: libraries
           Version: 8.0
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Transformation Utilities
          Assignee: unassignedbugs at nondot.org
          Reporter: Wolfgang_Pieb at playstation.sony.com
                CC: llvm-bugs at lists.llvm.org

bool foo(bool b) {
  return b;
}
//========= end of source =============


When compiled with -O2 -g, there is no location information for 'b'. The reason
appears to be the instcombine pass eliminating the zext that expands the
incoming parameter to an i8, while not being able to salvage the associated
debug info:

BEFORE:
  %frombool = zext i1 %b to i8
  call void @llvm.dbg.value(metadata i8 %frombool, metadata !12, ...

AFTER:
  <zext removed>
  call void @llvm.dbg.value(metadata i8 undef, metadata !12,

The core algorithm attempting the salvaging is in salvageDebugInfo() in
Transform/Utils/Local.cpp, which is why the component of this Bugzilla is
chosen this way.

Bug 40648 also seems to address problems with salvaging debug info and
instcombine, though they seem more complex there.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190411/09c16e3e/attachment.html>


More information about the llvm-bugs mailing list