2017-09-14 06:20:47 +08:00
|
|
|
# RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs -run-pass machine-scheduler -o - %s | FileCheck -check-prefix=GCN %s
|
|
|
|
|
|
|
|
# CGN-LABEL: name: flat_load_clustering
|
|
|
|
# GCN: FLAT_LOAD_DWORD
|
|
|
|
# GCN-NEXT: FLAT_LOAD_DWORD
|
|
|
|
--- |
|
2018-09-10 10:54:25 +08:00
|
|
|
define amdgpu_kernel void @flat_load_clustering(i32 addrspace(1)* nocapture %arg, i32 addrspace(4)* nocapture readonly %arg1) {
|
2017-09-14 06:20:47 +08:00
|
|
|
bb:
|
|
|
|
%tid = tail call i32 @llvm.amdgcn.workitem.id.x()
|
|
|
|
%idxprom = sext i32 %tid to i64
|
2018-09-10 10:54:25 +08:00
|
|
|
%gep1 = getelementptr inbounds i32, i32 addrspace(4)* %arg1, i64 %idxprom
|
|
|
|
%load1 = load i32, i32 addrspace(4)* %gep1, align 4
|
2017-09-14 06:20:47 +08:00
|
|
|
%gep2 = getelementptr inbounds i32, i32 addrspace(1)* %arg, i64 %idxprom
|
2018-09-10 10:54:25 +08:00
|
|
|
%gep34 = getelementptr inbounds i32, i32 addrspace(4)* %gep1, i64 4
|
|
|
|
%load2 = load i32, i32 addrspace(4)* %gep34, align 4
|
2017-09-14 06:20:47 +08:00
|
|
|
%gep4 = getelementptr inbounds i32, i32 addrspace(1)* %gep2, i64 4
|
|
|
|
store i32 %load1, i32 addrspace(1)* %gep2, align 4
|
|
|
|
store i32 %load2, i32 addrspace(1)* %gep4, align 4
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
declare i32 @llvm.amdgcn.workitem.id.x()
|
|
|
|
|
|
|
|
...
|
|
|
|
---
|
|
|
|
name: flat_load_clustering
|
[Alignment] Use llvm::Align in MachineFunction and TargetLowering - fixes mir parsing
Summary:
This catches malformed mir files which specify alignment as log2 instead of pow2.
See https://reviews.llvm.org/D65945 for reference,
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Reviewers: courbet
Subscribers: MatzeB, qcolombet, dschuff, arsenm, sdardis, nemanjai, jvesely, nhaehnle, hiraditya, kbarton, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, jsji, Petar.Avramovic, asbirlea, s.egerton, pzheng, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67433
llvm-svn: 371608
2019-09-11 19:16:48 +08:00
|
|
|
alignment: 1
|
2017-09-14 06:20:47 +08:00
|
|
|
exposesReturnsTwice: false
|
|
|
|
legalized: false
|
|
|
|
regBankSelected: false
|
|
|
|
selected: false
|
|
|
|
tracksRegLiveness: true
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: vgpr_32 }
|
|
|
|
- { id: 1, class: sgpr_64 }
|
|
|
|
- { id: 2, class: vgpr_32 }
|
|
|
|
- { id: 3, class: sreg_64_xexec }
|
|
|
|
- { id: 4, class: sreg_64_xexec }
|
|
|
|
- { id: 5, class: vgpr_32 }
|
|
|
|
- { id: 6, class: vgpr_32 }
|
|
|
|
- { id: 7, class: vgpr_32 }
|
|
|
|
- { id: 8, class: vgpr_32 }
|
|
|
|
- { id: 9, class: vreg_64 }
|
|
|
|
- { id: 10, class: vreg_64 }
|
|
|
|
- { id: 11, class: vgpr_32 }
|
|
|
|
- { id: 12, class: vreg_64 }
|
|
|
|
- { id: 13, class: vreg_64 }
|
|
|
|
liveins:
|
2018-02-01 06:04:26 +08:00
|
|
|
- { reg: '$vgpr0', virtual-reg: '%0' }
|
|
|
|
- { reg: '$sgpr4_sgpr5', virtual-reg: '%1' }
|
2017-09-14 06:20:47 +08:00
|
|
|
body: |
|
|
|
|
bb.0.bb:
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $vgpr0, $sgpr4_sgpr5
|
2017-09-14 06:20:47 +08:00
|
|
|
|
2018-02-01 06:04:26 +08:00
|
|
|
%1 = COPY $sgpr4_sgpr5
|
|
|
|
%0 = COPY $vgpr0
|
2019-05-01 06:08:23 +08:00
|
|
|
%3 = S_LOAD_DWORDX2_IMM %1, 0, 0, 0 :: (non-temporal dereferenceable invariant load 8 from `i64 addrspace(4)* undef`)
|
|
|
|
%4 = S_LOAD_DWORDX2_IMM %1, 8, 0, 0 :: (non-temporal dereferenceable invariant load 8 from `i64 addrspace(4)* undef`)
|
2018-02-01 06:04:26 +08:00
|
|
|
%7 = V_LSHLREV_B32_e32 2, %0, implicit $exec
|
|
|
|
%2 = V_MOV_B32_e32 0, implicit $exec
|
|
|
|
undef %12.sub0 = V_ADD_I32_e32 %4.sub0, %7, implicit-def $vcc, implicit $exec
|
2017-09-14 06:20:47 +08:00
|
|
|
%11 = COPY %4.sub1
|
2018-02-01 06:04:26 +08:00
|
|
|
%12.sub1 = V_ADDC_U32_e32 %11, %2, implicit-def dead $vcc, implicit killed $vcc, implicit $exec
|
2019-05-01 06:08:23 +08:00
|
|
|
%5 = FLAT_LOAD_DWORD %12, 0, 0, 0, 0, implicit $exec, implicit $flat_scr :: (load 4 from %ir.gep1)
|
2018-02-01 06:04:26 +08:00
|
|
|
undef %9.sub0 = V_ADD_I32_e32 %3.sub0, %7, implicit-def $vcc, implicit $exec
|
2017-09-14 06:20:47 +08:00
|
|
|
%8 = COPY %3.sub1
|
2018-02-01 06:04:26 +08:00
|
|
|
%9.sub1 = V_ADDC_U32_e32 %8, %2, implicit-def dead $vcc, implicit killed $vcc, implicit $exec
|
|
|
|
undef %13.sub0 = V_ADD_I32_e32 16, %12.sub0, implicit-def $vcc, implicit $exec
|
|
|
|
%13.sub1 = V_ADDC_U32_e32 %12.sub1, %2, implicit-def dead $vcc, implicit killed $vcc, implicit $exec
|
2019-05-01 06:08:23 +08:00
|
|
|
%6 = FLAT_LOAD_DWORD %13, 0, 0, 0, 0, implicit $exec, implicit $flat_scr :: (load 4 from %ir.gep34)
|
2018-02-01 06:04:26 +08:00
|
|
|
undef %10.sub0 = V_ADD_I32_e32 16, %9.sub0, implicit-def $vcc, implicit $exec
|
|
|
|
%10.sub1 = V_ADDC_U32_e32 %9.sub1, %2, implicit-def dead $vcc, implicit killed $vcc, implicit $exec
|
2019-05-01 06:08:23 +08:00
|
|
|
FLAT_STORE_DWORD %9, %5, 0, 0, 0, 0, implicit $exec, implicit $flat_scr :: (store 4 into %ir.gep2)
|
|
|
|
FLAT_STORE_DWORD %10, %6, 0, 0, 0, 0, implicit $exec, implicit $flat_scr :: (store 4 into %ir.gep4)
|
[AMDGPU] Add support for immediate operand for S_ENDPGM
Summary:
Add support for immediate operand in S_ENDPGM
Change-Id: I0c56a076a10980f719fb2a8f16407e9c301013f6
Reviewers: alexshap
Subscribers: qcolombet, arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, tpr, t-tye, eraman, arphaman, Petar.Avramovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59213
llvm-svn: 355902
2019-03-12 17:52:58 +08:00
|
|
|
S_ENDPGM 0
|
2017-09-14 06:20:47 +08:00
|
|
|
|
|
|
|
...
|