llvm.org GIT mirror llvm / f246669
AMDGPU/GlobalISel: Add InstrMapping for G_EXTRACT git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326715 91177308-0d34-0410-b5e6-96231b3b80d8 Matt Arsenault 2 years ago
2 changed file(s) with 40 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
305305 case AMDGPU::G_CONSTANT: {
306306 unsigned Size = MRI.getType(MI.getOperand(0).getReg()).getSizeInBits();
307307 OpdsMapping[0] = AMDGPU::getValueMapping(AMDGPU::SGPRRegBankID, Size);
308 break;
309 }
310 case AMDGPU::G_EXTRACT: {
311 unsigned BankID = getRegBankID(MI.getOperand(1).getReg(), MRI, *TRI);
312 unsigned DstSize = getSizeInBits(MI.getOperand(0).getReg(), MRI, *TRI);
313 unsigned SrcSize = getSizeInBits(MI.getOperand(1).getReg(), MRI, *TRI);
314 OpdsMapping[0] = AMDGPU::getValueMapping(BankID, DstSize);
315 OpdsMapping[1] = AMDGPU::getValueMapping(BankID, SrcSize);
316 OpdsMapping[2] = nullptr;
308317 break;
309318 }
310319 case AMDGPU::G_BITCAST: {
0 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
1 # RUN: llc -march=amdgcn -mcpu=fiji -run-pass=regbankselect -global-isel %s -verify-machineinstrs -o - -regbankselect-fast | FileCheck %s
2 # RUN: llc -march=amdgcn -mcpu=fiji -run-pass=regbankselect -global-isel %s -verify-machineinstrs -o - -regbankselect-greedy | FileCheck %s
3
4 ---
5 name: extract_lo32_i64_s
6 legalized: true
7
8 body: |
9 bb.0:
10 liveins: $sgpr0_sgpr1
11 ; CHECK-LABEL: name: extract_lo32_i64_s
12 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s64) = COPY $sgpr0_sgpr1
13 ; CHECK: [[EXTRACT:%[0-9]+]]:sgpr(s32) = G_EXTRACT [[COPY]](s64), 0
14 %0:_(s64) = COPY $sgpr0_sgpr1
15 %1:_(s32) = G_EXTRACT %0, 0
16 ...
17
18 ---
19 name: extract_lo32_i64_v
20 legalized: true
21
22 body: |
23 bb.0:
24 liveins: $vgpr0_vgpr1
25 ; CHECK-LABEL: name: extract_lo32_i64_v
26 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s64) = COPY $vgpr0_vgpr1
27 ; CHECK: [[EXTRACT:%[0-9]+]]:vgpr(s32) = G_EXTRACT [[COPY]](s64), 0
28 %0:_(s64) = COPY $vgpr0_vgpr1
29 %1:_(s32) = G_EXTRACT %0, 0
30 ...