summaryrefslogtreecommitdiffstats
path: root/llvm/test/DebugInfo/X86/bbjoin.ll
diff options
context:
space:
mode:
authorKeno Fischer <kfischer@college.harvard.edu>2016-01-07 22:18:37 +0000
committerKeno Fischer <kfischer@college.harvard.edu>2016-01-07 22:18:37 +0000
commitb3326be6add34fa7addb86eb9c2f4483be569b4b (patch)
treeed5fd8ab70b756c23be46d8ee8c517b33ee7af4e /llvm/test/DebugInfo/X86/bbjoin.ll
parent72132002314240b320c8ba3f4a04921cb87dce77 (diff)
downloadbcm5719-llvm-b3326be6add34fa7addb86eb9c2f4483be569b4b.tar.gz
bcm5719-llvm-b3326be6add34fa7addb86eb9c2f4483be569b4b.zip
[Verifier] Check that debug values have proper size
Summary: Teach the Verifier to make sure that the storage size given to llvm.dbg.declare or the value size given to llvm.dbg.value agree with what is declared in DebugInfo. This is implicitly assumed in a number of passes (e.g. in SROA). Additionally this catches a number of common mistakes, such as passing a pointer when a value was intended or vice versa. One complication comes from stack coloring which modifies the original IR when it merges allocas in order to make sure that if AA falls back to the IR it gets the correct result. However, given this new invariant, indiscriminately replacing one alloca by a different (differently sized one) is no longer valid. Fix this by just undefing out any use of the alloca in a dbg.declare in this case. Additionally, I had to fix a number of test cases. Of particular note: - I regenerated dbg-changes-codegen-branch-folding.ll from the given source as it was affected by the bug fixed in r256077 - two-cus-from-same-file.ll was changed to avoid having a variable-typed debug variable as that would depend on the target, even though this test is supposed to be generic - I had to manually declared size/align for reference type. See also the discussion for D14275/r253186. - fpstack-debuginstr-kill.ll required changing `double` to `long double` - most others were just a question of adding OP_deref Reviewers: aprantl Differential Revision: http://reviews.llvm.org/D14276 llvm-svn: 257105
Diffstat (limited to 'llvm/test/DebugInfo/X86/bbjoin.ll')
-rw-r--r--llvm/test/DebugInfo/X86/bbjoin.ll6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/test/DebugInfo/X86/bbjoin.ll b/llvm/test/DebugInfo/X86/bbjoin.ll
index 8061a8d2ce9..385cb6cc779 100644
--- a/llvm/test/DebugInfo/X86/bbjoin.ll
+++ b/llvm/test/DebugInfo/X86/bbjoin.ll
@@ -30,9 +30,9 @@ entry:
call void @llvm.lifetime.start(i64 4, i8* %0) #4, !dbg !14
tail call void @llvm.dbg.value(metadata i32 23, i64 0, metadata !9, metadata !15), !dbg !16
store i32 23, i32* %x, align 4, !dbg !16, !tbaa !17
- tail call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !9, metadata !15), !dbg !16
+ tail call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !9, metadata !DIExpression(DW_OP_deref)), !dbg !16
call void @g(i32* nonnull %x) #4, !dbg !21
- call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !9, metadata !15), !dbg !16
+ call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !9, metadata !DIExpression(DW_OP_deref)), !dbg !16
%1 = load i32, i32* %x, align 4, !dbg !22, !tbaa !17
%cmp = icmp eq i32 %1, 42, !dbg !24
br i1 %cmp, label %if.then, label %if.end, !dbg !25
@@ -44,7 +44,7 @@ if.then: ; preds = %entry
if.end: ; preds = %if.then, %entry
%2 = phi i32 [ 43, %if.then ], [ %1, %entry ], !dbg !27
- call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !9, metadata !15), !dbg !16
+ call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !9, metadata !DIExpression(DW_OP_deref)), !dbg !16
call void @llvm.lifetime.end(i64 4, i8* %0) #4, !dbg !28
ret i32 %2, !dbg !29
}
OpenPOWER on IntegriCloud