2017-07-02 23:24:08 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
|
|
|
; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s
|
2015-06-03 06:33:30 +08:00
|
|
|
|
|
|
|
declare void @free_v()
|
|
|
|
|
2017-07-02 23:24:08 +08:00
|
|
|
define void @f(i32* %x, i32 %c32, i32* %y) nounwind {
|
|
|
|
; CHECK-LABEL: f:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0: # %entry
|
2017-07-02 23:24:08 +08:00
|
|
|
; CHECK-NEXT: pushq %rbp
|
|
|
|
; CHECK-NEXT: pushq %r14
|
|
|
|
; CHECK-NEXT: pushq %rbx
|
|
|
|
; CHECK-NEXT: movq %rdx, %r14
|
|
|
|
; CHECK-NEXT: movl %esi, %ebp
|
|
|
|
; CHECK-NEXT: movl (%rdi), %ebx
|
|
|
|
; CHECK-NEXT: callq free_v
|
|
|
|
; CHECK-NEXT: testl %ebp, %ebp
|
|
|
|
; CHECK-NEXT: je .LBB0_2
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK-NEXT: # %bb.1: # %left
|
2017-07-02 23:24:08 +08:00
|
|
|
; CHECK-NEXT: movl %ebx, (%r14)
|
|
|
|
; CHECK-NEXT: .LBB0_2: # %merge
|
|
|
|
; CHECK-NEXT: popq %rbx
|
|
|
|
; CHECK-NEXT: popq %r14
|
|
|
|
; CHECK-NEXT: popq %rbp
|
|
|
|
; CHECK-NEXT: retq
|
2015-06-03 06:33:30 +08:00
|
|
|
entry:
|
|
|
|
%v = load i32, i32* %x, !invariant.load !0
|
|
|
|
call void @free_v()
|
|
|
|
%c = icmp ne i32 %c32, 0
|
|
|
|
br i1 %c, label %left, label %merge
|
|
|
|
|
|
|
|
left:
|
|
|
|
store i32 %v, i32* %y
|
|
|
|
br label %merge
|
|
|
|
|
|
|
|
merge:
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
!0 = !{}
|