llvm.org GIT mirror llvm / 2faa975
AMDGPU/GlobalISel: RegBankSelect for amdgcn.wqm.vote git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349882 91177308-0d34-0410-b5e6-96231b3b80d8 Matt Arsenault 10 months ago
2 changed file(s) with 62 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
588588 case Intrinsic::amdgcn_kernarg_segment_ptr: {
589589 unsigned Size = MRI.getType(MI.getOperand(0).getReg()).getSizeInBits();
590590 OpdsMapping[0] = AMDGPU::getValueMapping(AMDGPU::SGPRRegBankID, Size);
591 break;
592 }
593 case Intrinsic::amdgcn_wqm_vote: {
594 unsigned Size = MRI.getType(MI.getOperand(0).getReg()).getSizeInBits();
595 OpdsMapping[0] = OpdsMapping[2]
596 = AMDGPU::getValueMapping(AMDGPU::SGPRRegBankID, Size);
591597 break;
592598 }
593599 }
0 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
1 # RUN: llc -march=amdgcn -mcpu=fiji -run-pass=regbankselect %s -verify-machineinstrs -o - -regbankselect-fast | FileCheck %s
2 # RUN: llc -march=amdgcn -mcpu=fiji -run-pass=regbankselect %s -verify-machineinstrs -o - -regbankselect-greedy | FileCheck %s
3
4 ---
5 name: wqm_vote_scc
6 legalized: true
7
8 body: |
9 bb.0:
10 liveins: $sgpr0, $sgpr1
11 ; CHECK-LABEL: name: wqm_vote_scc
12 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
13 ; CHECK: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
14 ; CHECK: [[ICMP:%[0-9]+]]:scc(s1) = G_ICMP intpred(ne), [[COPY]](s32), [[COPY1]]
15 ; CHECK: [[COPY2:%[0-9]+]]:sgpr(s1) = COPY [[ICMP]](s1)
16 ; CHECK: [[INT:%[0-9]+]]:sgpr(s1) = G_INTRINSIC intrinsic(@llvm.amdgcn.wqm.vote), [[COPY2]](s1)
17 %0:_(s32) = COPY $sgpr0
18 %1:_(s32) = COPY $sgpr1
19 %2:_(s1) = G_ICMP intpred(ne), %0, %1
20 %3:_(s1) = G_INTRINSIC intrinsic(@llvm.amdgcn.wqm.vote), %2
21 ...
22
23 ---
24 name: wqm_vote_vcc
25 legalized: true
26
27 body: |
28 bb.0:
29 liveins: $vgpr0, $vgpr1
30 ; CHECK-LABEL: name: wqm_vote_vcc
31 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
32 ; CHECK: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
33 ; CHECK: [[ICMP:%[0-9]+]]:sgpr(s1) = G_ICMP intpred(ne), [[COPY]](s32), [[COPY1]]
34 ; CHECK: [[INT:%[0-9]+]]:sgpr(s1) = G_INTRINSIC intrinsic(@llvm.amdgcn.wqm.vote), [[ICMP]](s1)
35 %0:_(s32) = COPY $vgpr0
36 %1:_(s32) = COPY $vgpr1
37 %2:_(s1) = G_ICMP intpred(ne), %0, %1
38 %3:_(s1) = G_INTRINSIC intrinsic(@llvm.amdgcn.wqm.vote), %2
39 ...
40
41 ---
42 name: wqm_vote_sgpr
43 legalized: true
44
45 body: |
46 bb.0:
47 liveins: $sgpr0, $sgpr1
48 ; CHECK-LABEL: name: wqm_vote_sgpr
49 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
50 ; CHECK: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[COPY]](s32)
51 ; CHECK: [[INT:%[0-9]+]]:sgpr(s1) = G_INTRINSIC intrinsic(@llvm.amdgcn.wqm.vote), [[TRUNC]](s1)
52 %0:_(s32) = COPY $sgpr0
53 %1:_(s1) = G_TRUNC %0
54 %2:_(s1) = G_INTRINSIC intrinsic(@llvm.amdgcn.wqm.vote), %1
55 ...