[llvm-bugs] [Bug 43291] New: Debug info affects output from "opt -inline -adce"

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Sep 12 05:17:52 PDT 2019


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

            Bug ID: 43291
           Summary: Debug info affects output from "opt -inline -adce"
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Interprocedural Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: mikael.holmen at ericsson.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 22487
  --> https://bugs.llvm.org/attachment.cgi?id=22487&action=edit
ll reproducer

Reprocuce with:

opt -S -o - bbi-32603.ll -inline -adce

which produces

define i16 @g() !dbg !33 {
  %volatileloadslot.i = alloca %rec1198
  call void @llvm.dbg.value(metadata i16 0, metadata !30, metadata
!DIExpression()), !dbg !36
  %volatileloadslot.0..sroa_cast.i = bitcast %rec1198* %volatileloadslot.i to
i8*, !dbg !38
  call void @llvm.lifetime.start.p0i8(i64 4, i8*
%volatileloadslot.0..sroa_cast.i)
  %volatileloadslot.0..sroa_cast1.i = bitcast %rec1198* %volatileloadslot.i to
i8*
  call void @llvm.lifetime.end.p0i8(i64 4, i8*
%volatileloadslot.0..sroa_cast1.i)
  br label %bb1

bb1:                                              ; preds = %0
  ret i16 0
}

If we just remove

, !dbg !32

from

  %volatileloadslot.0..sroa_cast = bitcast %rec1198* %volatileloadslot to i8*,
!dbg !32

in the input we instead get:

define i16 @g() !dbg !30 {
  %volatileloadslot.i = alloca %rec1198
  %l.6.i = alloca [3 x i32]
  %1 = bitcast [3 x i32]* %l.6.i to i8*
  call void @llvm.lifetime.start.p0i8(i64 12, i8* %1)
  %volatileloadslot.0..sroa_cast.i = bitcast %rec1198* %volatileloadslot.i to
i8*
  call void @llvm.lifetime.start.p0i8(i64 4, i8*
%volatileloadslot.0..sroa_cast.i)
  %volatileloadslot.0..sroa_cast1.i = bitcast %rec1198* %volatileloadslot.i to
i8*
  call void @llvm.lifetime.end.p0i8(i64 4, i8*
%volatileloadslot.0..sroa_cast1.i)
  %2 = bitcast [3 x i32]* %l.6.i to i8*
  call void @llvm.lifetime.end.p0i8(i64 12, i8* %2)
  br label %bb1

bb1:                                              ; preds = %0
  ret i16 0
}


Looking at -debug printouts the first difference we see is that adce removes
the

call void @llvm.dbg.value(metadata i16 %k.4.par, metadata !30, metadata
!DIExpression()), !dbg !31

when the

, !dbg !32

isn't present on the bitcast, and then before we run the inliner we see this

CGSCCPASSMGR: Pass Dirtied SCC: Function Pass Manager
CGSCCPASSMGR: Refreshing SCC with 1 nodes:
Call graph node for function: 'f'<<0x643aed0>>  #uses=2

CGSCCPASSMGR: SCC Refresh didn't change call graph.

which isn't there when don't remove the

, !dbg !32

-- 
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/20190912/52cb532c/attachment.html>


More information about the llvm-bugs mailing list