1 ; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 ; RUN: llc -global-isel -mtriple=amdgcn-amd-amdhsa -verify-machineinstrs -stop-after=irtranslator < %s | FileCheck %s
4 define ptr @ptrmask_flat_i64(ptr %ptr, i64 %mask) {
5 ; CHECK-LABEL: name: ptrmask_flat_i64
6 ; CHECK: bb.1 (%ir-block.0):
7 ; CHECK-NEXT: liveins: $vgpr0, $vgpr1, $vgpr2, $vgpr3
9 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
10 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
11 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(p0) = G_MERGE_VALUES [[COPY]](s32), [[COPY1]](s32)
12 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $vgpr2
13 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $vgpr3
14 ; CHECK-NEXT: [[MV1:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[COPY2]](s32), [[COPY3]](s32)
15 ; CHECK-NEXT: [[PTRMASK:%[0-9]+]]:_(p0) = G_PTRMASK [[MV]], [[MV1]](s64)
16 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[PTRMASK]](p0)
17 ; CHECK-NEXT: $vgpr0 = COPY [[UV]](s32)
18 ; CHECK-NEXT: $vgpr1 = COPY [[UV1]](s32)
19 ; CHECK-NEXT: SI_RETURN implicit $vgpr0, implicit $vgpr1
20 %masked = call ptr @llvm.ptrmask.p0.i64(ptr %ptr, i64 %mask)
24 define ptr addrspace(3) @ptrmask_local_i32(ptr addrspace(3) %ptr, i32 %mask) {
25 ; CHECK-LABEL: name: ptrmask_local_i32
26 ; CHECK: bb.1 (%ir-block.0):
27 ; CHECK-NEXT: liveins: $vgpr0, $vgpr1
29 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p3) = COPY $vgpr0
30 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
31 ; CHECK-NEXT: [[PTRMASK:%[0-9]+]]:_(p3) = G_PTRMASK [[COPY]], [[COPY1]](s32)
32 ; CHECK-NEXT: $vgpr0 = COPY [[PTRMASK]](p3)
33 ; CHECK-NEXT: SI_RETURN implicit $vgpr0
34 %masked = call ptr addrspace(3) @llvm.ptrmask.p3.i32(ptr addrspace(3) %ptr, i32 %mask)
35 ret ptr addrspace(3) %masked
39 ; define <2 x ptr> @ptrmask_flat_i64_v2(<2 x ptr> %ptr, <2 x i64> %mask) {
40 ; %masked = call <2 x ptr> @llvm.ptrmask.v2p0.v2i64(<2 x ptr> %ptr, <2 x i64> %mask)
41 ; ret <2 x ptr> %masked
44 declare ptr @llvm.ptrmask.p0.i64(ptr, i64)
45 declare ptr addrspace(3) @llvm.ptrmask.p3.i32(ptr addrspace(3), i32)