1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s
4 ; Checks if "%7 = add nuw nsw i64 %4, %2" is moved before the last call
5 ; to minimize live-range.
7 define i64 @test(i1 %a, i64 %r1, i64 %r2, i64 %s1, i64 %s2, i64 %t1, i64 %t2) {
9 br i1 %a, label %then, label %else
15 %0 = phi i64 [ 4, %entry ], [ 10, %then ]
16 %r = phi i64 [ %r1, %entry ], [ %r2, %then ]
17 %s = phi i64 [ %s1, %entry ], [ %s2, %then ]
18 %t = phi i64 [ %t1, %entry ], [ %t2, %then ]
28 %1 = tail call i32 @_Z3foov()
29 %2 = zext i32 %1 to i64
30 %3 = tail call i32 @_Z3foov()
31 %4 = zext i32 %3 to i64
32 %5 = tail call i32 @_Z3foov()
33 %6 = zext i32 %5 to i64
34 %7 = add nuw nsw i64 %0, %r
35 tail call void @llvm.dbg.value(metadata i64 %7, i64 0, metadata !5, metadata !DIExpression()), !dbg !6
36 %8 = add nuw nsw i64 %2, %7
37 %9 = add nuw nsw i64 %4, %8
38 %10 = add nuw nsw i64 %6, %9
39 %11 = add nuw nsw i64 %s, %t
40 tail call void @llvm.dbg.value(metadata i64 %11, i64 0, metadata !5, metadata !DIExpression()), !dbg !6
41 %12 = add nuw nsw i64 %10, %11
45 declare i32 @_Z3foov()
46 declare void @llvm.dbg.value(metadata, i64, metadata, metadata)
49 !llvm.module.flags = !{!1, !2}
51 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, emissionKind: FullDebug)
52 !1 = !{i32 2, !"Dwarf Version", i32 4}
53 !2 = !{i32 2, !"Debug Info Version", i32 3}
54 !3 = !DIFile(filename: "a.c", directory: "./")
55 !4 = distinct !DISubprogram(name: "test", scope: !3, unit: !0)
56 !5 = !DILocalVariable(name: "x", scope: !4)
57 !6 = !DILocation(line: 4, scope: !4)