aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorAlok Kumar Sharma <AlokKumar.Sharma@amd.com>2020-03-03 09:50:13 +0530
committerSourabh Singh Tomar <SourabhSingh.Tomar@amd.com>2020-03-03 09:56:45 +0530
commit6f029dadf6900e6957f899a60486ec1e0740d555 (patch)
treecffdb13a25d23c5041bf43cd3f2ddb983f13e142 /clang/lib/Frontend/CompilerInvocation.cpp
parent57397eba7a8a7525cee69e10ad90697ff74bb521 (diff)
downloadllvm-6f029dadf6900e6957f899a60486ec1e0740d555.zip
llvm-6f029dadf6900e6957f899a60486ec1e0740d555.tar.gz
llvm-6f029dadf6900e6957f899a60486ec1e0740d555.tar.bz2
[DebugInfo] Avoid generating duplicate llvm.dbg.value
Summary: This is to avoid generating duplicate llvm.dbg.value instrinsic if it already exists after the Instruction. Before inserting llvm.dbg.value instruction, LLVM checks if the same instruction is already present before the instruction to avoid duplicates. Currently it misses to check if it already exists after the instruction. flang generates IR like this. %4 = load i32, i32* %i1_311, align 4, !dbg !42 call void @llvm.dbg.value(metadata i32 %4, metadata !35, metadata !DIExpression()), !dbg !33 When this IR is processed in llvm, it ends up inserting duplicates. %4 = load i32, i32* %i1_311, align 4, !dbg !42 call void @llvm.dbg.value(metadata i32 %4, metadata !35, metadata !DIExpression()), !dbg !33 call void @llvm.dbg.value(metadata i32 %4, metadata !35, metadata !DIExpression()), !dbg !33 We have now updated LdStHasDebugValue to include the cases when instruction is already followed by same dbg.value instruction we intend to insert. Now, Definition and usage of function LdStHasDebugValue are deleted. RemoveRedundantDbgInstrs is called for the cleanup of duplicate dbg.value's Testing: Added unit test for validation check-llvm check-debuginfo (the debug info integration tests) Reviewers: aprantl, probinson, dblaikie, jmorse, jini.susan.george SouraVX, awpandey, dstenb, vsk Reviewed By: aprantl, jmorse, dstenb, vsk Differential Revision: https://reviews.llvm.org/D74030
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions