1 # RUN: llc -mtriple=x86_64-apple-macosx10.12.0 -O3 -run-pass=block-placement -o - %s | FileCheck %s
5 source_filename = "test.ll"
6 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
8 declare void @stub(ptr)
10 define i32 @f(ptr %ptr, i1 %cond) {
12 br i1 %cond, label %left, label %right
14 left: ; preds = %entry
15 %is_null = icmp eq ptr %ptr, null
16 br i1 %is_null, label %null, label %not_null, !prof !0, !make.implicit !1
18 not_null: ; preds = %left
19 %val = load i32, ptr %ptr
23 call void @stub(ptr %ptr)
26 right: ; preds = %entry
27 call void @stub(ptr null)
31 ; Function Attrs: nounwind
32 declare void @llvm.stackprotector(ptr, ptr) #0
34 attributes #0 = { nounwind }
36 !0 = !{!"branch_weights", i32 1048575, i32 1}
44 tracksRegLiveness: true
49 # CHECK: $eax = FAULTING_OP 1, %bb.3, 1684, killed $rdi, 1, $noreg, 0, $noreg :: (load (s32) from %ir.ptr)
50 # CHECK-NEXT: JMP_1 %bb.2
53 # CHECK: bb.2.not_null:
57 successors: %bb.1(0x7ffff800), %bb.3(0x00000800)
60 frame-setup PUSH64r undef $rax, implicit-def $rsp, implicit $rsp
61 CFI_INSTRUCTION def_cfa_offset 16
62 TEST8ri $sil, 1, implicit-def $eflags, implicit killed $esi
63 JCC_1 %bb.3, 4, implicit killed $eflags
66 successors: %bb.2(0x7ffff800), %bb.4(0x00000800)
69 $eax = FAULTING_OP 1, %bb.2, 1684, killed $rdi, 1, $noreg, 0, $noreg :: (load (s32) from %ir.ptr)
75 $rcx = POP64r implicit-def $rsp, implicit $rsp
81 CALL64pcrel32 @stub, csr_64, implicit $rsp, implicit $rdi, implicit-def $rsp
84 dead $edi = XOR32rr undef $edi, undef $edi, implicit-def dead $eflags, implicit-def $rdi
85 CALL64pcrel32 @stub, csr_64, implicit $rsp, implicit $rdi, implicit-def $rsp