brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.5 KiB · de7a807 Raw
89 lines · plain
1# RUN: llc -mtriple=x86_64-apple-macosx10.12.0 -O3 -run-pass=block-placement -o - %s | FileCheck %s2# RUN: llc -mtriple=x86_64-apple-macosx10.12.0 -O3 -passes='require<profile-summary>,function(machine-function(block-placement))' -o - %s | FileCheck %s3 4--- |5  ; ModuleID = 'test.ll'6  source_filename = "test.ll"7  target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"8  9  declare void @stub(ptr)10  11  define i32 @f(ptr %ptr, i1 %cond) {12  entry:13    br i1 %cond, label %left, label %right14  15  left:                                             ; preds = %entry16    %is_null = icmp eq ptr %ptr, null17    br i1 %is_null, label %null, label %not_null, !prof !0, !make.implicit !118  19  not_null:                                         ; preds = %left20    %val = load i32, ptr %ptr21    ret i32 %val22  23  null:                                             ; preds = %left24    call void @stub(ptr %ptr)25    unreachable26  27  right:                                            ; preds = %entry28    call void @stub(ptr null)29    unreachable30  }31  32  ; Function Attrs: nounwind33  declare void @llvm.stackprotector(ptr, ptr) #034  35  attributes #0 = { nounwind }36  37  !0 = !{!"branch_weights", i32 1048575, i32 1}38  !1 = !{}39 40...41---42# CHECK: name:            f43name:            f44alignment:       1645tracksRegLiveness: true46liveins:         47  - { reg: '$rdi' }48  - { reg: '$esi' }49 50# CHECK: $eax = FAULTING_OP 1, %bb.3, 1684, killed $rdi, 1, $noreg, 0, $noreg :: (load (s32) from %ir.ptr)51# CHECK-NEXT: JMP_1 %bb.252# CHECK: bb.3.null:53# CHECK:  bb.4.right:54# CHECK:  bb.2.not_null:55 56body:             |57  bb.0.entry:58    successors: %bb.1(0x7ffff800), %bb.3(0x00000800)59    liveins: $esi, $rdi60  61    frame-setup PUSH64r undef $rax, implicit-def $rsp, implicit $rsp62    CFI_INSTRUCTION def_cfa_offset 1663    TEST8ri $sil, 1, implicit-def $eflags, implicit killed $esi64    JCC_1 %bb.3, 4, implicit killed $eflags65  66  bb.1.left:67    successors: %bb.2(0x7ffff800), %bb.4(0x00000800)68    liveins: $rdi69  70    $eax = FAULTING_OP 1, %bb.2, 1684, killed $rdi, 1, $noreg, 0, $noreg :: (load (s32) from %ir.ptr)71    JMP_1 %bb.472  73  bb.4.not_null:74    liveins: $rdi, $eax75  76    $rcx = POP64r implicit-def $rsp, implicit $rsp77    RET64 $eax78 79  bb.2.null:80    liveins: $rdi81  82    CALL64pcrel32 @stub, csr_64, implicit $rsp, implicit $rdi, implicit-def $rsp83  84  bb.3.right:85    dead $edi = XOR32rr undef $edi, undef $edi, implicit-def dead $eflags, implicit-def $rdi86    CALL64pcrel32 @stub, csr_64, implicit $rsp, implicit $rdi, implicit-def $rsp87  88...89