Matt Arsenault | 71bcbd4 | 2017-08-11 20:42:08 +0000 | [diff] [blame] | 1 | ; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -codegenprepare %s | FileCheck %s |
| 2 | |
| 3 | define internal fastcc void @callee(i32* nocapture %p, i32 %a) #0 { |
| 4 | store volatile i32 %a, i32* %p, align 4 |
| 5 | ret void |
| 6 | } |
| 7 | |
| 8 | ; CHECK-LABEL: @func_caller( |
| 9 | ; CHECK: tail call fastcc void @callee( |
| 10 | ; CHECK-NEXT: ret void |
| 11 | ; CHECK: ret void |
| 12 | define void @func_caller(i32* nocapture %p, i32 %a, i32 %b) #0 { |
| 13 | entry: |
| 14 | %cmp = icmp eq i32 %b, 0 |
| 15 | br i1 %cmp, label %bb, label %ret |
| 16 | |
| 17 | bb: |
| 18 | tail call fastcc void @callee(i32* %p, i32 %a) |
| 19 | br label %ret |
| 20 | |
| 21 | ret: |
| 22 | ret void |
| 23 | } |
| 24 | |
| 25 | ; CHECK-LABEL: @kernel_caller( |
| 26 | ; CHECK: tail call fastcc void @callee( |
| 27 | ; CHECK-NEXT: br label %ret |
| 28 | |
| 29 | ; CHECK: ret void |
| 30 | define amdgpu_kernel void @kernel_caller(i32* nocapture %p, i32 %a, i32 %b) #0 { |
| 31 | entry: |
| 32 | %cmp = icmp eq i32 %b, 0 |
| 33 | br i1 %cmp, label %bb, label %ret |
| 34 | |
| 35 | bb: |
| 36 | tail call fastcc void @callee(i32* %p, i32 %a) |
| 37 | br label %ret |
| 38 | |
| 39 | ret: |
| 40 | ret void |
| 41 | } |
| 42 | |
| 43 | attributes #0 = { nounwind } |