|
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py |
| 2 | +; RUN: llc -mtriple=x86_64-- < %s | FileCheck %s |
| 3 | + |
| 4 | +declare void @clobber() |
| 5 | + |
| 6 | +define void @test(i1 %c, i64* %p, i64* noalias %p2) nounwind { |
| 7 | +; CHECK-LABEL: test: |
| 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: movq %rsi, %r14 |
| 16 | +; CHECK-NEXT: movl %edi, %r15d |
| 17 | +; CHECK-NEXT: xorl %eax, %eax |
| 18 | +; CHECK-NEXT: jmpq *.LJTI0_0(,%rax,8) |
| 19 | +; CHECK-NEXT: .LBB0_1: # %split.3 |
| 20 | +; CHECK-NEXT: movq (%r14), %rbp |
| 21 | +; CHECK-NEXT: testb $1, %r15b |
| 22 | +; CHECK-NEXT: je .LBB0_3 |
| 23 | +; CHECK-NEXT: # %bb.2: # %clobber |
| 24 | +; CHECK-NEXT: callq clobber@PLT |
| 25 | +; CHECK-NEXT: .LBB0_3: # %sink |
| 26 | +; CHECK-NEXT: movq %rbp, (%rbx) |
| 27 | +; CHECK-NEXT: .LBB0_4: # %latch |
| 28 | +; CHECK-NEXT: # =>This Inner Loop Header: Depth=1 |
| 29 | +; CHECK-NEXT: xorl %eax, %eax |
| 30 | +; CHECK-NEXT: jmpq *.LJTI0_0(,%rax,8) |
| 31 | +entry: |
| 32 | + %val = load i64, i64* %p, align 8 |
| 33 | + br label %loop |
| 34 | + |
| 35 | +loop: |
| 36 | + switch i8 undef, label %unreachable [ |
| 37 | + i8 0, label %latch |
| 38 | + i8 1, label %split.1 |
| 39 | + i8 2, label %split.2 |
| 40 | + i8 3, label %split.3 |
| 41 | + ] |
| 42 | + |
| 43 | +unreachable: |
| 44 | + unreachable |
| 45 | + |
| 46 | +split.3: |
| 47 | + br i1 %c, label %clobber, label %sink |
| 48 | + |
| 49 | +split.1: |
| 50 | + br label %latch |
| 51 | + |
| 52 | +split.2: |
| 53 | + br label %latch |
| 54 | + |
| 55 | +clobber: |
| 56 | + call void @clobber() |
| 57 | + br label %sink |
| 58 | + |
| 59 | +sink: |
| 60 | + store i64 %val, i64* %p2, align 8 |
| 61 | + br label %latch |
| 62 | + |
| 63 | +latch: |
| 64 | + %phi = phi i64 [ 0, %sink ], [ 0, %split.2 ], [ 1, %split.1 ], [ 0, %loop ] |
| 65 | + %phi.live = add i64 %phi, 0 |
| 66 | + br label %loop |
| 67 | +} |
0 commit comments