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: unassignedb...@nondot.org
          Reporter: mikael.hol...@ericsson.com
                CC: llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to