[PATCH] D64595: [Debuginfo][SROA] Need to handle dbg.value in SROA pass.
Alexey Lapshin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 3 10:53:53 PDT 2019
avl marked 2 inline comments as done.
avl added inline comments.
================
Comment at: llvm/test/DebugInfo/X86/sroa-after-inlining.ll:35
+; CHECK: _Z3barv
+; CHECK: %[[NAME:.*]] = call i32 @_Z3foov
+; CHECK: llvm.dbg.value(metadata i32 %[[NAME]], metadata [[METADATA_IDX1:![0-9]+]]
----------------
aprantl wrote:
> RESULT?
yes. actual IR looks like this :
before second SROA :
call void @llvm.dbg.declare(metadata %struct.S1* %result, metadata !12, metadata !DIExpression()), !dbg !21
%call = call i32 @_Z3foov(), !dbg !21
%coerce.dive = getelementptr inbounds %struct.S1, %struct.S1* %result, i64 0, i32 0, !dbg !21
store i32 %call, i32* %coerce.dive, align 4, !dbg !21
after second SROA:
%call = call i32 @_Z3foov(), !dbg !21
call void @llvm.dbg.value(metadata i32 %call, metadata !12, metadata !DIExpression()), !dbg !22
================
Comment at: llvm/test/DebugInfo/X86/sroa-after-inlining.ll:89
+define linkonce_odr dso_local zeroext i1 @_ZN2S16IsNullEv(%struct.S1* %this) #4 comdat align 2 !dbg !33 {
+entry:
+ %this.addr = alloca %struct.S1*, align 8
----------------
aprantl wrote:
> Do we actually need this function body or could this be converted to a forward-declaration?
yes, we do. it` body used during inlining :
opt %s -sroa -instcombine -inline -instcombine -sroa
without proper inlining second SROA pass does not have a chance to do optimization.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64595/new/
https://reviews.llvm.org/D64595
More information about the llvm-commits
mailing list