1 ; Check that debug intrinsics do not affect code generation.
3 ; RUN: llc < %s -mtriple=aarch64-unknown-unknown -mattr=+avx | FileCheck --check-prefix=AARCH64-CHECK %s
5 define i64 @simulate(<2 x i32> %a) {
7 %rand = tail call i64 @lrand48()
10 body: ; preds = %body, %entry
11 %0 = phi <2 x i32> [ %add, %body ], [ zeroinitializer, %entry ]
12 %add = add <2 x i32> %0, %a
13 %rand1 = tail call i64 @lrand48() #3
14 %cmp = icmp eq i64 %rand1, 0
15 br i1 %cmp, label %end, label %body
18 %c = bitcast <2 x i32> %add to i64
19 %res = add i64 %rand, %c
23 ; AARCH64-CHECK: simulate:
24 ; AARCH64-CHECK: movi v0.2d, #0000000000000000
25 ; AARCH64-CHECK: bl lrand48
26 ; AARCH64-CHECK: mov x19, x0
27 ; AARCH64-CHECK: BB0_1:
30 define i64 @simulateWithDebugIntrinsic(<2 x i32> %a) local_unnamed_addr {
32 %rand = tail call i64 @lrand48() #3
33 tail call void @llvm.dbg.value(metadata i64 %rand, i64 0, metadata !6, metadata !7), !dbg !8
36 body: ; preds = %body, %entry
37 %0 = phi <2 x i32> [ %add, %body ], [ zeroinitializer, %entry ]
38 %add = add <2 x i32> %0, %a
39 %rand1 = tail call i64 @lrand48() #3
40 %cmp = icmp eq i64 %rand1, 0
41 br i1 %cmp, label %end, label %body
44 %c = bitcast <2 x i32> %add to i64
45 %res = add i64 %rand, %c
49 ; AARCH64-CHECK: simulateWithDebugIntrinsic
50 ; AARCH64-CHECK: movi v0.2d, #0000000000000000
51 ; AARCH64-CHECK: bl lrand48
52 ; AARCH64-CHECK: mov x19, x0
53 ; AARCH64-CHECK: BB1_1:
56 define i64 @simulateWithDbgDeclare(<2 x i32> %a) local_unnamed_addr {
58 %rand = tail call i64 @lrand48() #3
59 tail call void @llvm.dbg.declare(metadata i64 %rand, metadata !6, metadata !7), !dbg !8
62 body: ; preds = %body, %entry
63 %0 = phi <2 x i32> [ %add, %body ], [ zeroinitializer, %entry ]
64 %add = add <2 x i32> %0, %a
65 %rand1 = tail call i64 @lrand48() #3
66 %cmp = icmp eq i64 %rand1, 0
67 br i1 %cmp, label %end, label %body
70 %c = bitcast <2 x i32> %add to i64
71 %res = add i64 %rand, %c
75 ; AARCH64-CHECK: simulateWithDbgDeclare:
76 ; AARCH64-CHECK: movi v0.2d, #0000000000000000
77 ; AARCH64-CHECK: bl lrand48
78 ; AARCH64-CHECK: mov x19, x0
79 ; AARCH64-CHECK: BB2_1:
81 declare i64 @lrand48()
83 declare void @llvm.dbg.value(metadata, i64, metadata, metadata)
84 declare void @llvm.dbg.declare(metadata, metadata, metadata)
87 !llvm.module.flags = !{!3, !4}
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)
96 !8 = !DILocation(line: 132, column: 2, scope: !5)