This revision focuses on fixing the bug proposed here: https://bugs.llvm.org/show_bug.cgi?id=48722
In the original ll file:
%tmp9 = trunc i64 %tmp8 to i32, !dbg !29 call void @llvm.dbg.value(metadata i32 %tmp9, metadata !18, metadata !DIExpression()), !dbg !29 %tmp10 = sext i32 %tmp9 to i64, !dbg !30 call void @llvm.dbg.value(metadata i64 %tmp10, metadata !19, metadata !DIExpression()), !dbg !30
is optimized to
%tmp9 = trunc i64 %tmp8 to i32, !dbg !29 call void @llvm.dbg.value(metadata i32 %tmp9, metadata !18, metadata !DIExpression()), !dbg !29 %0 = zext i32 %tmp9 to i64 call void @llvm.dbg.value(metadata i64 %0, metadata !19, metadata !DIExpression()), !dbg !30
There exists a one-to-one relationship between %tmp10 = sext i32 %tmp9 to i64, !dbg !30 and %0 = zext i32 %tmp9 to i64, however, the debug location is unnecessarily dropped.
This revision proposes to preserve the debug location !30 of the original instruction.
Nit: Please can you capitalize 'check' and add a full stop to this sentence? I'm not sure if this is specified in the style guide but I tend to treat comments in tests the same as comments in source code.