brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.1 KiB · fb40653 Raw
97 lines · plain
1; Check that debug intrinsics do not affect code generation.2 3; RUN: llc < %s -mtriple=aarch64-unknown-unknown -mattr=+avx | FileCheck --check-prefix=AARCH64-CHECK %s4 5define i64 @simulate(<2 x i32> %a) {6entry:7  %rand = tail call i64 @lrand48()8  br label %body9 10body:                                        ; preds = %body, %entry11  %0 = phi <2 x i32> [ %add, %body ], [ zeroinitializer, %entry ]12  %add = add <2 x i32> %0, %a13  %rand1 = tail call i64 @lrand48() #314  %cmp = icmp eq i64 %rand1, 015  br i1 %cmp, label %end, label %body16 17end:                                        ; preds = %body18  %c = bitcast <2 x i32> %add to i6419  %res = add i64 %rand, %c20  ret i64 %res21}22 23; AARCH64-CHECK: simulate:24; AARCH64-CHECK: movi v0.2d, #000000000000000025; AARCH64-CHECK: bl lrand4826; AARCH64-CHECK: mov x19, x027; AARCH64-CHECK: BB0_1:28 29 30define i64 @simulateWithDebugIntrinsic(<2 x i32> %a) local_unnamed_addr  {31entry:32  %rand = tail call i64 @lrand48() #333  tail call void @llvm.dbg.value(metadata i64 %rand, i64 0, metadata !6, metadata !7), !dbg !834  br label %body35 36body:                                        ; preds = %body, %entry37  %0 = phi <2 x i32> [ %add, %body ], [ zeroinitializer, %entry ]38  %add = add <2 x i32> %0, %a39  %rand1 = tail call i64 @lrand48() #340  %cmp = icmp eq i64 %rand1, 041  br i1 %cmp, label %end, label %body42 43end:                                        ; preds = %body44  %c = bitcast <2 x i32> %add to i6445  %res = add i64 %rand, %c46  ret i64 %res47}48 49; AARCH64-CHECK: simulateWithDebugIntrinsic50; AARCH64-CHECK: movi v0.2d, #000000000000000051; AARCH64-CHECK: bl lrand4852; AARCH64-CHECK: mov x19, x053; AARCH64-CHECK: BB1_1:54 55 56define i64 @simulateWithDbgDeclare(<2 x i32> %a) local_unnamed_addr  {57entry:58  %rand = tail call i64 @lrand48() #359  tail call void @llvm.dbg.declare(metadata i64 %rand, metadata !6, metadata !7), !dbg !860  br label %body61 62body:                                        ; preds = %body, %entry63  %0 = phi <2 x i32> [ %add, %body ], [ zeroinitializer, %entry ]64  %add = add <2 x i32> %0, %a65  %rand1 = tail call i64 @lrand48() #366  %cmp = icmp eq i64 %rand1, 067  br i1 %cmp, label %end, label %body68 69end:                                        ; preds = %body70  %c = bitcast <2 x i32> %add to i6471  %res = add i64 %rand, %c72  ret i64 %res73}74 75; AARCH64-CHECK: simulateWithDbgDeclare:76; AARCH64-CHECK: movi v0.2d, #000000000000000077; AARCH64-CHECK: bl lrand4878; AARCH64-CHECK: mov x19, x079; AARCH64-CHECK: BB2_1:80 81declare i64 @lrand48()82 83declare void @llvm.dbg.value(metadata, i64, metadata, metadata)84declare void @llvm.dbg.declare(metadata, metadata, metadata)85 86!llvm.dbg.cu = !{!1}87!llvm.module.flags = !{!3, !4}88 89!1 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, runtimeVersion: 0, emissionKind: FullDebug)90!2 = !DIFile(filename: "test.ll", directory: ".")91!3 = !{i32 2, !"Dwarf Version", i32 4}92!4 = !{i32 2, !"Debug Info Version", i32 3}93!5 = distinct !DISubprogram(name: "simulateWithDebugIntrinsic", scope: !2, file: !2, line: 64, isLocal: false, isDefinition: true, scopeLine: 65, unit: !1)94!6 = !DILocalVariable(name: "randv", scope: !5, file: !2, line: 69)95!7 = !DIExpression()96!8 = !DILocation(line: 132, column: 2, scope: !5)97