diff options
Diffstat (limited to 'test/Transforms/LoopRotate')
-rw-r--r-- | test/Transforms/LoopRotate/crash.ll | 18 | ||||
-rw-r--r-- | test/Transforms/LoopRotate/dbgvalue.ll | 52 | ||||
-rw-r--r-- | test/Transforms/LoopRotate/pr22337.ll | 24 |
3 files changed, 68 insertions, 26 deletions
diff --git a/test/Transforms/LoopRotate/crash.ll b/test/Transforms/LoopRotate/crash.ll index fd922cb..e95f9a1 100644 --- a/test/Transforms/LoopRotate/crash.ll +++ b/test/Transforms/LoopRotate/crash.ll @@ -153,3 +153,21 @@ entry: "5": ; preds = %"3", %entry ret void } + +; PR21968 +define void @test8(i1 %C, i8* %P) #0 { +entry: + br label %for.cond + +for.cond: ; preds = %for.inc, %entry + br i1 %C, label %l_bad, label %for.body + +for.body: ; preds = %for.cond + indirectbr i8* %P, [label %for.inc, label %l_bad] + +for.inc: ; preds = %for.body + br label %for.cond + +l_bad: ; preds = %for.body, %for.cond + ret void +} diff --git a/test/Transforms/LoopRotate/dbgvalue.ll b/test/Transforms/LoopRotate/dbgvalue.ll index 4da0776..846b366 100644 --- a/test/Transforms/LoopRotate/dbgvalue.ll +++ b/test/Transforms/LoopRotate/dbgvalue.ll @@ -6,7 +6,7 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon define i32 @tak(i32 %x, i32 %y, i32 %z) nounwind ssp { ; CHECK-LABEL: define i32 @tak( ; CHECK: entry -; CHECK-NEXT: call void @llvm.dbg.value(metadata !{i32 %x} +; CHECK-NEXT: call void @llvm.dbg.value(metadata i32 %x entry: br label %tailrecurse @@ -15,9 +15,9 @@ tailrecurse: ; preds = %if.then, %entry %x.tr = phi i32 [ %x, %entry ], [ %call, %if.then ] %y.tr = phi i32 [ %y, %entry ], [ %call9, %if.then ] %z.tr = phi i32 [ %z, %entry ], [ %call14, %if.then ] - tail call void @llvm.dbg.value(metadata !{i32 %x.tr}, i64 0, metadata !6, metadata !{}), !dbg !7 - tail call void @llvm.dbg.value(metadata !{i32 %y.tr}, i64 0, metadata !8, metadata !{}), !dbg !9 - tail call void @llvm.dbg.value(metadata !{i32 %z.tr}, i64 0, metadata !10, metadata !{}), !dbg !11 + tail call void @llvm.dbg.value(metadata i32 %x.tr, i64 0, metadata !6, metadata !{}), !dbg !7 + tail call void @llvm.dbg.value(metadata i32 %y.tr, i64 0, metadata !8, metadata !{}), !dbg !9 + tail call void @llvm.dbg.value(metadata i32 %z.tr, i64 0, metadata !10, metadata !{}), !dbg !11 %cmp = icmp slt i32 %y.tr, %x.tr, !dbg !12 br i1 %cmp, label %if.then, label %if.end, !dbg !12 @@ -72,7 +72,7 @@ for.body: for.inc: %dec = add i64 %i.0, -1 - tail call void @llvm.dbg.value(metadata !{i64 %dec}, i64 0, metadata !{metadata !"undef"}, metadata !{}) + tail call void @llvm.dbg.value(metadata i64 %dec, i64 0, metadata !{!"undef"}, metadata !{}) br label %for.cond for.end: @@ -84,24 +84,24 @@ for.end: !llvm.module.flags = !{!20} !llvm.dbg.sp = !{!0} -!0 = metadata !{metadata !"0x2e\00tak\00tak\00\0032\000\001\000\006\00256\000\000", metadata !18, metadata !1, metadata !3, null, i32 (i32, i32, i32)* @tak, null, null, null} ; [ DW_TAG_subprogram ] [line 32] [def] [scope 0] [tak] -!1 = metadata !{metadata !"0x29", metadata !18} ; [ DW_TAG_file_type ] -!2 = metadata !{metadata !"0x11\0012\00clang version 2.9 (trunk 125492)\001\00\000\00\000", metadata !18, metadata !19, metadata !19, null, null, null} ; [ DW_TAG_compile_unit ] -!3 = metadata !{metadata !"0x15\00\000\000\000\000\000\000", metadata !18, metadata !1, null, metadata !4, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] -!4 = metadata !{metadata !5} -!5 = metadata !{metadata !"0x24\00int\000\0032\0032\000\000\005", null, metadata !2} ; [ DW_TAG_base_type ] -!6 = metadata !{metadata !"0x101\00x\0032\000", metadata !0, metadata !1, metadata !5} ; [ DW_TAG_arg_variable ] -!7 = metadata !{i32 32, i32 13, metadata !0, null} -!8 = metadata !{metadata !"0x101\00y\0032\000", metadata !0, metadata !1, metadata !5} ; [ DW_TAG_arg_variable ] -!9 = metadata !{i32 32, i32 20, metadata !0, null} -!10 = metadata !{metadata !"0x101\00z\0032\000", metadata !0, metadata !1, metadata !5} ; [ DW_TAG_arg_variable ] -!11 = metadata !{i32 32, i32 27, metadata !0, null} -!12 = metadata !{i32 33, i32 3, metadata !13, null} -!13 = metadata !{metadata !"0xb\0032\0030\006", metadata !18, metadata !0} ; [ DW_TAG_lexical_block ] -!14 = metadata !{i32 34, i32 5, metadata !15, null} -!15 = metadata !{metadata !"0xb\0033\0014\007", metadata !18, metadata !13} ; [ DW_TAG_lexical_block ] -!16 = metadata !{i32 36, i32 3, metadata !13, null} -!17 = metadata !{i32 37, i32 1, metadata !13, null} -!18 = metadata !{metadata !"/Volumes/Lalgate/cj/llvm/projects/llvm-test/SingleSource/Benchmarks/BenchmarkGame/recursive.c", metadata !"/Volumes/Lalgate/cj/D/projects/llvm-test/SingleSource/Benchmarks/BenchmarkGame"} -!19 = metadata !{i32 0} -!20 = metadata !{i32 1, metadata !"Debug Info Version", i32 2} +!0 = !{!"0x2e\00tak\00tak\00\0032\000\001\000\006\00256\000\000", !18, !1, !3, null, i32 (i32, i32, i32)* @tak, null, null, null} ; [ DW_TAG_subprogram ] [line 32] [def] [scope 0] [tak] +!1 = !{!"0x29", !18} ; [ DW_TAG_file_type ] +!2 = !{!"0x11\0012\00clang version 2.9 (trunk 125492)\001\00\000\00\000", !18, !19, !19, null, null, null} ; [ DW_TAG_compile_unit ] +!3 = !{!"0x15\00\000\000\000\000\000\000", !18, !1, null, !4, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!4 = !{!5} +!5 = !{!"0x24\00int\000\0032\0032\000\000\005", null, !2} ; [ DW_TAG_base_type ] +!6 = !{!"0x101\00x\0032\000", !0, !1, !5} ; [ DW_TAG_arg_variable ] +!7 = !MDLocation(line: 32, column: 13, scope: !0) +!8 = !{!"0x101\00y\0032\000", !0, !1, !5} ; [ DW_TAG_arg_variable ] +!9 = !MDLocation(line: 32, column: 20, scope: !0) +!10 = !{!"0x101\00z\0032\000", !0, !1, !5} ; [ DW_TAG_arg_variable ] +!11 = !MDLocation(line: 32, column: 27, scope: !0) +!12 = !MDLocation(line: 33, column: 3, scope: !13) +!13 = !{!"0xb\0032\0030\006", !18, !0} ; [ DW_TAG_lexical_block ] +!14 = !MDLocation(line: 34, column: 5, scope: !15) +!15 = !{!"0xb\0033\0014\007", !18, !13} ; [ DW_TAG_lexical_block ] +!16 = !MDLocation(line: 36, column: 3, scope: !13) +!17 = !MDLocation(line: 37, column: 1, scope: !13) +!18 = !{!"/Volumes/Lalgate/cj/llvm/projects/llvm-test/SingleSource/Benchmarks/BenchmarkGame/recursive.c", !"/Volumes/Lalgate/cj/D/projects/llvm-test/SingleSource/Benchmarks/BenchmarkGame"} +!19 = !{i32 0} +!20 = !{i32 1, !"Debug Info Version", i32 2} diff --git a/test/Transforms/LoopRotate/pr22337.ll b/test/Transforms/LoopRotate/pr22337.ll new file mode 100644 index 0000000..c2893db --- /dev/null +++ b/test/Transforms/LoopRotate/pr22337.ll @@ -0,0 +1,24 @@ +; RUN: opt < %s -loop-rotate -S | FileCheck %s + +@a = external global i8, align 4 +@tmp = global i8* @a + +define void @f() { +; CHECK-LABEL: define void @f( +; CHECK: getelementptr i8* @a, i32 0 +entry: + br label %for.preheader + +for.preheader: + br i1 undef, label %if.then8, label %for.body + +for.body: + br i1 undef, label %if.end, label %if.then8 + +if.end: + %arrayidx = getelementptr i8* @a, i32 0 + br label %for.preheader + +if.then8: + unreachable +} |