1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=x86_64-- < %s | FileCheck %s
4 declare void @clobber()
6 define void @test(i1 %c, ptr %p, ptr noalias %p2) nounwind {
8 ; CHECK: # %bb.0: # %entry
9 ; CHECK-NEXT: pushq %rbp
10 ; CHECK-NEXT: pushq %r15
11 ; CHECK-NEXT: pushq %r14
12 ; CHECK-NEXT: pushq %rbx
13 ; CHECK-NEXT: pushq %rax
14 ; CHECK-NEXT: movq %rdx, %rbx
15 ; CHECK-NEXT: movl %edi, %ebp
16 ; CHECK-NEXT: movq (%rsi), %r14
17 ; CHECK-NEXT: movb $1, %r15b
18 ; CHECK-NEXT: jmp .LBB0_1
19 ; CHECK-NEXT: .p2align 4
20 ; CHECK-NEXT: .LBB0_4: # %sink
21 ; CHECK-NEXT: # in Loop: Header=BB0_1 Depth=1
22 ; CHECK-NEXT: movq %r14, (%rbx)
23 ; CHECK-NEXT: .LBB0_1: # %loop
24 ; CHECK-NEXT: # =>This Inner Loop Header: Depth=1
25 ; CHECK-NEXT: testb %r15b, %r15b
26 ; CHECK-NEXT: jne .LBB0_1
27 ; CHECK-NEXT: # %bb.2: # %split.3
28 ; CHECK-NEXT: # in Loop: Header=BB0_1 Depth=1
29 ; CHECK-NEXT: testb $1, %bpl
30 ; CHECK-NEXT: je .LBB0_4
31 ; CHECK-NEXT: # %bb.3: # %clobber
32 ; CHECK-NEXT: # in Loop: Header=BB0_1 Depth=1
33 ; CHECK-NEXT: callq clobber@PLT
34 ; CHECK-NEXT: jmp .LBB0_4
36 %val = load i64, ptr %p, align 8
40 switch i8 undef, label %unreachable [
51 br i1 %c, label %clobber, label %sink
64 store i64 %val, ptr %p2, align 8
68 %phi = phi i64 [ 0, %sink ], [ 0, %split.2 ], [ 1, %split.1 ], [ 0, %loop ]
69 %phi.live = add i64 %phi, 0