Tom Stellard | bc4497b | 2016-02-12 23:45:29 +0000 | [diff] [blame] | 1 | ; RUN: llc -march=amdgcn -mcpu=verde -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s |
| 2 | ; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s |
| 3 | |
| 4 | ; FUNC-LABEL: {{^}}v_and_i64_br: |
Alexander Timofeev | 982aee6 | 2017-07-04 17:32:00 +0000 | [diff] [blame] | 5 | ; SI: s_and_b64 |
Matt Arsenault | 3dbeefa | 2017-03-21 21:39:51 +0000 | [diff] [blame] | 6 | define amdgpu_kernel void @v_and_i64_br(i64 addrspace(1)* %out, i64 addrspace(1)* %aptr, i64 addrspace(1)* %bptr) { |
Tom Stellard | bc4497b | 2016-02-12 23:45:29 +0000 | [diff] [blame] | 7 | entry: |
| 8 | %tid = call i32 @llvm.amdgcn.mbcnt.lo(i32 -1, i32 0) #0 |
| 9 | %tmp0 = icmp eq i32 %tid, 0 |
| 10 | br i1 %tmp0, label %if, label %endif |
| 11 | |
| 12 | if: |
| 13 | %a = load i64, i64 addrspace(1)* %aptr, align 8 |
| 14 | %b = load i64, i64 addrspace(1)* %bptr, align 8 |
| 15 | %and = and i64 %a, %b |
| 16 | br label %endif |
| 17 | |
| 18 | endif: |
| 19 | %tmp1 = phi i64 [%and, %if], [0, %entry] |
| 20 | store i64 %tmp1, i64 addrspace(1)* %out, align 8 |
| 21 | ret void |
| 22 | } |
| 23 | |
| 24 | declare i32 @llvm.amdgcn.mbcnt.lo(i32, i32) #0 |
| 25 | |
| 26 | attributes #0 = { nounwind readnone } |