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 %r14
11 ; CHECK-NEXT: pushq %rbx
12 ; CHECK-NEXT: movq %rdx, %rbx
13 ; CHECK-NEXT: movl %edi, %r14d
14 ; CHECK-NEXT: movq (%rsi), %rbp
15 ; CHECK-NEXT: xorl %eax, %eax
16 ; CHECK-NEXT: jmpq *.LJTI0_0(,%rax,8)
17 ; CHECK-NEXT: .LBB0_1: # %split.3
18 ; CHECK-NEXT: testb $1, %r14b
19 ; CHECK-NEXT: je .LBB0_3
20 ; CHECK-NEXT: # %bb.2: # %clobber
21 ; CHECK-NEXT: callq clobber@PLT
22 ; CHECK-NEXT: .LBB0_3: # %sink
23 ; CHECK-NEXT: movq %rbp, (%rbx)
24 ; CHECK-NEXT: .LBB0_4: # %latch
25 ; CHECK-NEXT: # =>This Inner Loop Header: Depth=1
26 ; CHECK-NEXT: xorl %eax, %eax
27 ; CHECK-NEXT: jmpq *.LJTI0_0(,%rax,8)
29 %val = load i64, ptr %p, align 8
33 switch i8 undef, label %unreachable [
44 br i1 %c, label %clobber, label %sink
57 store i64 %val, ptr %p2, align 8
61 %phi = phi i64 [ 0, %sink ], [ 0, %split.2 ], [ 1, %split.1 ], [ 0, %loop ]
62 %phi.live = add i64 %phi, 0