2019-06-24 22:53:56 +08:00
|
|
|
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
|
|
|
|
# RUN: llc -mtriple=amdgcn-amd-amdhsa -verify-machineinstrs -run-pass si-fold-operands,dead-mi-elimination %s -o - | FileCheck -check-prefix=GCN %s
|
|
|
|
|
2020-01-22 06:27:57 +08:00
|
|
|
# Kernels can have no FP
|
2019-06-24 22:53:56 +08:00
|
|
|
---
|
2020-01-22 06:27:57 +08:00
|
|
|
name: kernel_no_fold_fi_non_stack_rsrc_and_soffset
|
2019-06-24 22:53:56 +08:00
|
|
|
tracksRegLiveness: true
|
|
|
|
frameInfo:
|
|
|
|
maxAlignment: 4
|
|
|
|
localFrameSize: 4
|
|
|
|
stack:
|
|
|
|
- { id: 0, size: 4, alignment: 4, local-offset: 0 }
|
|
|
|
machineFunctionInfo:
|
|
|
|
isEntryFunction: true
|
|
|
|
scratchRSrcReg: '$sgpr96_sgpr97_sgpr98_sgpr99'
|
2020-01-22 06:27:57 +08:00
|
|
|
stackPtrOffsetReg: '$sgpr32'
|
2019-06-24 22:53:56 +08:00
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $sgpr12_sgpr13_sgpr14_sgpr15
|
|
|
|
|
2020-01-22 06:27:57 +08:00
|
|
|
; GCN-LABEL: name: kernel_no_fold_fi_non_stack_rsrc_and_soffset
|
2019-06-24 22:53:56 +08:00
|
|
|
; GCN: liveins: $sgpr12_sgpr13_sgpr14_sgpr15
|
|
|
|
; GCN: [[COPY:%[0-9]+]]:sgpr_128 = COPY $sgpr12_sgpr13_sgpr14_sgpr15
|
|
|
|
; GCN: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 %stack.0, implicit $exec
|
[AMDGPU] Extend buffer intrinsics with swizzling
Summary:
Extend cachepolicy operand in the new VMEM buffer intrinsics
to supply information whether the buffer data is swizzled.
Also, propagate this information to MIR.
Intrinsics updated:
int_amdgcn_raw_buffer_load
int_amdgcn_raw_buffer_load_format
int_amdgcn_raw_buffer_store
int_amdgcn_raw_buffer_store_format
int_amdgcn_raw_tbuffer_load
int_amdgcn_raw_tbuffer_store
int_amdgcn_struct_buffer_load
int_amdgcn_struct_buffer_load_format
int_amdgcn_struct_buffer_store
int_amdgcn_struct_buffer_store_format
int_amdgcn_struct_tbuffer_load
int_amdgcn_struct_tbuffer_store
Furthermore, disable merging of VMEM buffer instructions
in SI Load/Store optimizer, if the "swizzled" bit on the instruction
is on.
The default value of the bit is 0, meaning that data in buffer
is linear and buffer instructions can be merged.
There is no difference in the generated code with this commit.
However, in the future it will be expected that front-ends
use buffer intrinsics with correct "swizzled" bit set.
Reviewers: arsenm, nhaehnle, tpr
Reviewed By: nhaehnle
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, arphaman, jfb, Petar.Avramovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68200
llvm-svn: 373491
2019-10-03 01:22:36 +08:00
|
|
|
; GCN: [[BUFFER_LOAD_DWORD_IDXEN:%[0-9]+]]:vgpr_32 = BUFFER_LOAD_DWORD_IDXEN [[V_MOV_B32_e32_]], [[COPY]], 0, 0, 0, 0, 0, 0, 0, implicit $exec
|
2019-06-24 22:53:56 +08:00
|
|
|
; GCN: $vgpr0 = COPY [[BUFFER_LOAD_DWORD_IDXEN]]
|
|
|
|
; GCN: SI_RETURN_TO_EPILOG $vgpr0
|
|
|
|
%0:sgpr_128 = COPY $sgpr12_sgpr13_sgpr14_sgpr15
|
|
|
|
%1:sreg_32_xm0 = S_MOV_B32 0
|
|
|
|
%2:vgpr_32 = V_MOV_B32_e32 %stack.0, implicit $exec
|
[AMDGPU] Extend buffer intrinsics with swizzling
Summary:
Extend cachepolicy operand in the new VMEM buffer intrinsics
to supply information whether the buffer data is swizzled.
Also, propagate this information to MIR.
Intrinsics updated:
int_amdgcn_raw_buffer_load
int_amdgcn_raw_buffer_load_format
int_amdgcn_raw_buffer_store
int_amdgcn_raw_buffer_store_format
int_amdgcn_raw_tbuffer_load
int_amdgcn_raw_tbuffer_store
int_amdgcn_struct_buffer_load
int_amdgcn_struct_buffer_load_format
int_amdgcn_struct_buffer_store
int_amdgcn_struct_buffer_store_format
int_amdgcn_struct_tbuffer_load
int_amdgcn_struct_tbuffer_store
Furthermore, disable merging of VMEM buffer instructions
in SI Load/Store optimizer, if the "swizzled" bit on the instruction
is on.
The default value of the bit is 0, meaning that data in buffer
is linear and buffer instructions can be merged.
There is no difference in the generated code with this commit.
However, in the future it will be expected that front-ends
use buffer intrinsics with correct "swizzled" bit set.
Reviewers: arsenm, nhaehnle, tpr
Reviewed By: nhaehnle
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, arphaman, jfb, Petar.Avramovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68200
llvm-svn: 373491
2019-10-03 01:22:36 +08:00
|
|
|
%3:vgpr_32 = BUFFER_LOAD_DWORD_IDXEN %2, %0, %1, 0, 0, 0, 0, 0, 0, implicit $exec
|
2019-06-24 22:53:56 +08:00
|
|
|
$vgpr0 = COPY %3
|
|
|
|
SI_RETURN_TO_EPILOG $vgpr0
|
|
|
|
|
|
|
|
...
|
|
|
|
|
|
|
|
---
|
2020-01-22 06:27:57 +08:00
|
|
|
name: kernel_no_fold_fi_non_stack_rsrc
|
2019-06-24 22:53:56 +08:00
|
|
|
tracksRegLiveness: true
|
|
|
|
frameInfo:
|
|
|
|
maxAlignment: 4
|
|
|
|
localFrameSize: 4
|
|
|
|
stack:
|
|
|
|
- { id: 0, size: 4, alignment: 4, local-offset: 0 }
|
|
|
|
machineFunctionInfo:
|
|
|
|
isEntryFunction: true
|
|
|
|
scratchRSrcReg: '$sgpr96_sgpr97_sgpr98_sgpr99'
|
|
|
|
stackPtrOffsetReg: '$sgpr32'
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $sgpr12_sgpr13_sgpr14_sgpr15
|
|
|
|
|
2020-01-22 06:27:57 +08:00
|
|
|
; GCN-LABEL: name: kernel_no_fold_fi_non_stack_rsrc
|
2019-06-24 22:53:56 +08:00
|
|
|
; GCN: liveins: $sgpr12_sgpr13_sgpr14_sgpr15
|
|
|
|
; GCN: [[COPY:%[0-9]+]]:sgpr_128 = COPY $sgpr12_sgpr13_sgpr14_sgpr15
|
|
|
|
; GCN: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 %stack.0, implicit $exec
|
[AMDGPU] Extend buffer intrinsics with swizzling
Summary:
Extend cachepolicy operand in the new VMEM buffer intrinsics
to supply information whether the buffer data is swizzled.
Also, propagate this information to MIR.
Intrinsics updated:
int_amdgcn_raw_buffer_load
int_amdgcn_raw_buffer_load_format
int_amdgcn_raw_buffer_store
int_amdgcn_raw_buffer_store_format
int_amdgcn_raw_tbuffer_load
int_amdgcn_raw_tbuffer_store
int_amdgcn_struct_buffer_load
int_amdgcn_struct_buffer_load_format
int_amdgcn_struct_buffer_store
int_amdgcn_struct_buffer_store_format
int_amdgcn_struct_tbuffer_load
int_amdgcn_struct_tbuffer_store
Furthermore, disable merging of VMEM buffer instructions
in SI Load/Store optimizer, if the "swizzled" bit on the instruction
is on.
The default value of the bit is 0, meaning that data in buffer
is linear and buffer instructions can be merged.
There is no difference in the generated code with this commit.
However, in the future it will be expected that front-ends
use buffer intrinsics with correct "swizzled" bit set.
Reviewers: arsenm, nhaehnle, tpr
Reviewed By: nhaehnle
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, arphaman, jfb, Petar.Avramovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68200
llvm-svn: 373491
2019-10-03 01:22:36 +08:00
|
|
|
; GCN: [[BUFFER_LOAD_DWORD_IDXEN:%[0-9]+]]:vgpr_32 = BUFFER_LOAD_DWORD_IDXEN [[V_MOV_B32_e32_]], [[COPY]], $sgpr32, 0, 0, 0, 0, 0, 0, implicit $exec
|
2019-06-24 22:53:56 +08:00
|
|
|
; GCN: $vgpr0 = COPY [[BUFFER_LOAD_DWORD_IDXEN]]
|
|
|
|
; GCN: SI_RETURN_TO_EPILOG $vgpr0
|
|
|
|
%0:sgpr_128 = COPY $sgpr12_sgpr13_sgpr14_sgpr15
|
|
|
|
%2:vgpr_32 = V_MOV_B32_e32 %stack.0, implicit $exec
|
[AMDGPU] Extend buffer intrinsics with swizzling
Summary:
Extend cachepolicy operand in the new VMEM buffer intrinsics
to supply information whether the buffer data is swizzled.
Also, propagate this information to MIR.
Intrinsics updated:
int_amdgcn_raw_buffer_load
int_amdgcn_raw_buffer_load_format
int_amdgcn_raw_buffer_store
int_amdgcn_raw_buffer_store_format
int_amdgcn_raw_tbuffer_load
int_amdgcn_raw_tbuffer_store
int_amdgcn_struct_buffer_load
int_amdgcn_struct_buffer_load_format
int_amdgcn_struct_buffer_store
int_amdgcn_struct_buffer_store_format
int_amdgcn_struct_tbuffer_load
int_amdgcn_struct_tbuffer_store
Furthermore, disable merging of VMEM buffer instructions
in SI Load/Store optimizer, if the "swizzled" bit on the instruction
is on.
The default value of the bit is 0, meaning that data in buffer
is linear and buffer instructions can be merged.
There is no difference in the generated code with this commit.
However, in the future it will be expected that front-ends
use buffer intrinsics with correct "swizzled" bit set.
Reviewers: arsenm, nhaehnle, tpr
Reviewed By: nhaehnle
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, arphaman, jfb, Petar.Avramovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68200
llvm-svn: 373491
2019-10-03 01:22:36 +08:00
|
|
|
%3:vgpr_32 = BUFFER_LOAD_DWORD_IDXEN %2, %0, $sgpr32, 0, 0, 0, 0, 0, 0, implicit $exec
|
2019-06-24 22:53:56 +08:00
|
|
|
$vgpr0 = COPY %3
|
|
|
|
SI_RETURN_TO_EPILOG $vgpr0
|
|
|
|
|
|
|
|
...
|
|
|
|
|
|
|
|
---
|
2020-01-22 06:27:57 +08:00
|
|
|
name: kernel_no_fold_fi_non_stack_soffset
|
2019-06-24 22:53:56 +08:00
|
|
|
tracksRegLiveness: true
|
|
|
|
frameInfo:
|
|
|
|
maxAlignment: 4
|
|
|
|
localFrameSize: 4
|
|
|
|
stack:
|
|
|
|
- { id: 0, size: 4, alignment: 4, local-offset: 0 }
|
|
|
|
machineFunctionInfo:
|
|
|
|
isEntryFunction: true
|
|
|
|
scratchRSrcReg: '$sgpr0_sgpr1_sgpr2_sgpr3'
|
|
|
|
stackPtrOffsetReg: '$sgpr32'
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
|
2020-01-22 06:27:57 +08:00
|
|
|
; GCN-LABEL: name: kernel_no_fold_fi_non_stack_soffset
|
|
|
|
; GCN: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 %stack.0, implicit $exec
|
|
|
|
; GCN: [[V_MOV_B32_e32_1:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 7, implicit $exec
|
|
|
|
; GCN: BUFFER_STORE_DWORD_OFFEN [[V_MOV_B32_e32_1]], [[V_MOV_B32_e32_]], $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, 0, 0, 0, 0, implicit $exec
|
|
|
|
; GCN: [[BUFFER_LOAD_DWORD_OFFEN:%[0-9]+]]:vgpr_32 = BUFFER_LOAD_DWORD_OFFEN [[V_MOV_B32_e32_]], $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, 0, 0, 0, 0, implicit $exec
|
|
|
|
; GCN: $vgpr0 = COPY [[BUFFER_LOAD_DWORD_OFFEN]]
|
|
|
|
; GCN: S_ENDPGM 0, implicit $vgpr0
|
|
|
|
%0:vgpr_32 = V_MOV_B32_e32 %stack.0, implicit $exec
|
|
|
|
%1:vgpr_32 = V_MOV_B32_e32 7, implicit $exec
|
|
|
|
%2:sreg_32_xm0 = S_MOV_B32 0
|
|
|
|
|
|
|
|
BUFFER_STORE_DWORD_OFFEN %1:vgpr_32, %0:vgpr_32, $sgpr0_sgpr1_sgpr2_sgpr3, %2, 0, 0, 0, 0, 0, 0, implicit $exec
|
|
|
|
%3:vgpr_32 = BUFFER_LOAD_DWORD_OFFEN %0:vgpr_32, $sgpr0_sgpr1_sgpr2_sgpr3, %2, 0, 0, 0, 0, 0, 0, implicit $exec
|
|
|
|
$vgpr0 = COPY %3
|
|
|
|
S_ENDPGM 0, implicit $vgpr0
|
|
|
|
|
|
|
|
...
|
|
|
|
|
|
|
|
---
|
|
|
|
name: kernel_fold_fi_mubuf
|
|
|
|
tracksRegLiveness: true
|
|
|
|
frameInfo:
|
|
|
|
maxAlignment: 4
|
|
|
|
localFrameSize: 4
|
|
|
|
stack:
|
|
|
|
- { id: 0, size: 4, alignment: 4, local-offset: 0 }
|
|
|
|
machineFunctionInfo:
|
|
|
|
isEntryFunction: true
|
|
|
|
scratchRSrcReg: '$sgpr0_sgpr1_sgpr2_sgpr3'
|
|
|
|
stackPtrOffsetReg: '$sgpr32'
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
|
|
|
|
; GCN-LABEL: name: kernel_fold_fi_mubuf
|
2019-06-24 22:53:56 +08:00
|
|
|
; GCN: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 7, implicit $exec
|
[AMDGPU] Extend buffer intrinsics with swizzling
Summary:
Extend cachepolicy operand in the new VMEM buffer intrinsics
to supply information whether the buffer data is swizzled.
Also, propagate this information to MIR.
Intrinsics updated:
int_amdgcn_raw_buffer_load
int_amdgcn_raw_buffer_load_format
int_amdgcn_raw_buffer_store
int_amdgcn_raw_buffer_store_format
int_amdgcn_raw_tbuffer_load
int_amdgcn_raw_tbuffer_store
int_amdgcn_struct_buffer_load
int_amdgcn_struct_buffer_load_format
int_amdgcn_struct_buffer_store
int_amdgcn_struct_buffer_store_format
int_amdgcn_struct_tbuffer_load
int_amdgcn_struct_tbuffer_store
Furthermore, disable merging of VMEM buffer instructions
in SI Load/Store optimizer, if the "swizzled" bit on the instruction
is on.
The default value of the bit is 0, meaning that data in buffer
is linear and buffer instructions can be merged.
There is no difference in the generated code with this commit.
However, in the future it will be expected that front-ends
use buffer intrinsics with correct "swizzled" bit set.
Reviewers: arsenm, nhaehnle, tpr
Reviewed By: nhaehnle
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, arphaman, jfb, Petar.Avramovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68200
llvm-svn: 373491
2019-10-03 01:22:36 +08:00
|
|
|
; GCN: BUFFER_STORE_DWORD_OFFEN [[V_MOV_B32_e32_]], %stack.0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr32, 0, 0, 0, 0, 0, 0, implicit $exec
|
|
|
|
; GCN: [[BUFFER_LOAD_DWORD_OFFEN:%[0-9]+]]:vgpr_32 = BUFFER_LOAD_DWORD_OFFEN %stack.0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr32, 0, 0, 0, 0, 0, 0, implicit $exec
|
2019-06-24 22:53:56 +08:00
|
|
|
; GCN: $vgpr0 = COPY [[BUFFER_LOAD_DWORD_OFFEN]]
|
|
|
|
; GCN: S_ENDPGM 0, implicit $vgpr0
|
|
|
|
%0:vgpr_32 = V_MOV_B32_e32 %stack.0, implicit $exec
|
|
|
|
%1:vgpr_32 = V_MOV_B32_e32 7, implicit $exec
|
|
|
|
|
2020-01-22 06:27:57 +08:00
|
|
|
BUFFER_STORE_DWORD_OFFEN %1:vgpr_32, %0:vgpr_32, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr32, 0, 0, 0, 0, 0, 0, implicit $exec
|
|
|
|
%2:vgpr_32 = BUFFER_LOAD_DWORD_OFFEN %0:vgpr_32, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr32, 0, 0, 0, 0, 0, 0, implicit $exec
|
2019-06-24 22:53:56 +08:00
|
|
|
$vgpr0 = COPY %2
|
|
|
|
S_ENDPGM 0, implicit $vgpr0
|
|
|
|
|
|
|
|
...
|
|
|
|
|
2020-01-22 06:27:57 +08:00
|
|
|
|
|
|
|
# Functions have an unswizzled SP/FP relative to the wave offset
|
2019-06-24 22:53:56 +08:00
|
|
|
---
|
2020-01-22 06:27:57 +08:00
|
|
|
name: function_no_fold_fi_non_stack_rsrc_and_soffset
|
2019-06-24 22:53:56 +08:00
|
|
|
tracksRegLiveness: true
|
|
|
|
frameInfo:
|
|
|
|
maxAlignment: 4
|
|
|
|
localFrameSize: 4
|
|
|
|
stack:
|
|
|
|
- { id: 0, size: 4, alignment: 4, local-offset: 0 }
|
|
|
|
machineFunctionInfo:
|
2020-01-22 06:27:57 +08:00
|
|
|
isEntryFunction: false
|
|
|
|
scratchRSrcReg: '$sgpr96_sgpr97_sgpr98_sgpr99'
|
|
|
|
frameOffsetReg: '$sgpr32'
|
|
|
|
stackPtrOffsetReg: '$sgpr32'
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $sgpr12_sgpr13_sgpr14_sgpr15
|
|
|
|
|
|
|
|
; GCN-LABEL: name: function_no_fold_fi_non_stack_rsrc_and_soffset
|
|
|
|
; GCN: liveins: $sgpr12_sgpr13_sgpr14_sgpr15
|
|
|
|
; GCN: [[COPY:%[0-9]+]]:sgpr_128 = COPY $sgpr12_sgpr13_sgpr14_sgpr15
|
|
|
|
; GCN: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 %stack.0, implicit $exec
|
|
|
|
; GCN: [[BUFFER_LOAD_DWORD_IDXEN:%[0-9]+]]:vgpr_32 = BUFFER_LOAD_DWORD_IDXEN [[V_MOV_B32_e32_]], [[COPY]], 0, 0, 0, 0, 0, 0, 0, implicit $exec
|
|
|
|
; GCN: $vgpr0 = COPY [[BUFFER_LOAD_DWORD_IDXEN]]
|
|
|
|
; GCN: SI_RETURN_TO_EPILOG $vgpr0
|
|
|
|
%0:sgpr_128 = COPY $sgpr12_sgpr13_sgpr14_sgpr15
|
|
|
|
%1:sreg_32_xm0 = S_MOV_B32 0
|
|
|
|
%2:vgpr_32 = V_MOV_B32_e32 %stack.0, implicit $exec
|
|
|
|
%3:vgpr_32 = BUFFER_LOAD_DWORD_IDXEN %2, %0, %1, 0, 0, 0, 0, 0, 0, implicit $exec
|
|
|
|
$vgpr0 = COPY %3
|
|
|
|
SI_RETURN_TO_EPILOG $vgpr0
|
|
|
|
|
|
|
|
...
|
|
|
|
|
|
|
|
---
|
|
|
|
name: function_no_fold_fi_non_stack_rsrc
|
|
|
|
tracksRegLiveness: true
|
|
|
|
frameInfo:
|
|
|
|
maxAlignment: 4
|
|
|
|
localFrameSize: 4
|
|
|
|
stack:
|
|
|
|
- { id: 0, size: 4, alignment: 4, local-offset: 0 }
|
|
|
|
machineFunctionInfo:
|
|
|
|
isEntryFunction: false
|
|
|
|
scratchRSrcReg: '$sgpr96_sgpr97_sgpr98_sgpr99'
|
|
|
|
frameOffsetReg: '$sgpr32'
|
|
|
|
stackPtrOffsetReg: '$sgpr32'
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $sgpr12_sgpr13_sgpr14_sgpr15
|
|
|
|
|
|
|
|
; GCN-LABEL: name: function_no_fold_fi_non_stack_rsrc
|
|
|
|
; GCN: liveins: $sgpr12_sgpr13_sgpr14_sgpr15
|
|
|
|
; GCN: [[COPY:%[0-9]+]]:sgpr_128 = COPY $sgpr12_sgpr13_sgpr14_sgpr15
|
|
|
|
; GCN: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 %stack.0, implicit $exec
|
|
|
|
; GCN: [[BUFFER_LOAD_DWORD_IDXEN:%[0-9]+]]:vgpr_32 = BUFFER_LOAD_DWORD_IDXEN [[V_MOV_B32_e32_]], [[COPY]], $sgpr32, 0, 0, 0, 0, 0, 0, implicit $exec
|
|
|
|
; GCN: $vgpr0 = COPY [[BUFFER_LOAD_DWORD_IDXEN]]
|
|
|
|
; GCN: SI_RETURN_TO_EPILOG $vgpr0
|
|
|
|
%0:sgpr_128 = COPY $sgpr12_sgpr13_sgpr14_sgpr15
|
|
|
|
%2:vgpr_32 = V_MOV_B32_e32 %stack.0, implicit $exec
|
|
|
|
%3:vgpr_32 = BUFFER_LOAD_DWORD_IDXEN %2, %0, $sgpr32, 0, 0, 0, 0, 0, 0, implicit $exec
|
|
|
|
$vgpr0 = COPY %3
|
|
|
|
SI_RETURN_TO_EPILOG $vgpr0
|
|
|
|
|
|
|
|
...
|
|
|
|
|
|
|
|
---
|
|
|
|
name: function_no_fold_fi_non_stack_soffset
|
|
|
|
tracksRegLiveness: true
|
|
|
|
frameInfo:
|
|
|
|
maxAlignment: 4
|
|
|
|
localFrameSize: 4
|
|
|
|
stack:
|
|
|
|
- { id: 0, size: 4, alignment: 4, local-offset: 0 }
|
|
|
|
machineFunctionInfo:
|
|
|
|
isEntryFunction: false
|
|
|
|
scratchRSrcReg: '$sgpr0_sgpr1_sgpr2_sgpr3'
|
|
|
|
frameOffsetReg: '$sgpr32'
|
|
|
|
stackPtrOffsetReg: '$sgpr32'
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
|
|
|
|
; GCN-LABEL: name: function_no_fold_fi_non_stack_soffset
|
|
|
|
; GCN: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 7, implicit $exec
|
|
|
|
; GCN: BUFFER_STORE_DWORD_OFFEN [[V_MOV_B32_e32_]], %stack.0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr32, 0, 0, 0, 0, 0, 0, implicit $exec
|
|
|
|
; GCN: [[BUFFER_LOAD_DWORD_OFFEN:%[0-9]+]]:vgpr_32 = BUFFER_LOAD_DWORD_OFFEN %stack.0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr32, 0, 0, 0, 0, 0, 0, implicit $exec
|
|
|
|
; GCN: $vgpr0 = COPY [[BUFFER_LOAD_DWORD_OFFEN]]
|
|
|
|
; GCN: S_ENDPGM 0, implicit $vgpr0
|
|
|
|
%0:vgpr_32 = V_MOV_B32_e32 %stack.0, implicit $exec
|
|
|
|
%1:vgpr_32 = V_MOV_B32_e32 7, implicit $exec
|
|
|
|
|
|
|
|
BUFFER_STORE_DWORD_OFFEN %1:vgpr_32, %0:vgpr_32, $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, 0, 0, 0, 0, implicit $exec
|
|
|
|
%2:vgpr_32 = BUFFER_LOAD_DWORD_OFFEN %0:vgpr_32, $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, 0, 0, 0, 0, implicit $exec
|
|
|
|
$vgpr0 = COPY %2
|
|
|
|
S_ENDPGM 0, implicit $vgpr0
|
|
|
|
|
|
|
|
...
|
|
|
|
|
|
|
|
---
|
|
|
|
name: function_fold_fi_mubuf_wave_relative
|
|
|
|
tracksRegLiveness: true
|
|
|
|
frameInfo:
|
|
|
|
maxAlignment: 4
|
|
|
|
localFrameSize: 4
|
|
|
|
stack:
|
|
|
|
- { id: 0, size: 4, alignment: 4, local-offset: 0 }
|
|
|
|
machineFunctionInfo:
|
|
|
|
isEntryFunction: false
|
|
|
|
scratchRSrcReg: '$sgpr0_sgpr1_sgpr2_sgpr3'
|
|
|
|
frameOffsetReg: '$sgpr32'
|
|
|
|
stackPtrOffsetReg: '$sgpr32'
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
|
|
|
|
; GCN-LABEL: name: function_fold_fi_mubuf_wave_relative
|
|
|
|
; GCN: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 7, implicit $exec
|
|
|
|
; GCN: BUFFER_STORE_DWORD_OFFEN [[V_MOV_B32_e32_]], %stack.0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr32, 0, 0, 0, 0, 0, 0, implicit $exec
|
|
|
|
; GCN: [[BUFFER_LOAD_DWORD_OFFEN:%[0-9]+]]:vgpr_32 = BUFFER_LOAD_DWORD_OFFEN %stack.0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr32, 0, 0, 0, 0, 0, 0, implicit $exec
|
|
|
|
; GCN: $vgpr0 = COPY [[BUFFER_LOAD_DWORD_OFFEN]]
|
|
|
|
; GCN: S_ENDPGM 0, implicit $vgpr0
|
|
|
|
%0:vgpr_32 = V_MOV_B32_e32 %stack.0, implicit $exec
|
|
|
|
%1:vgpr_32 = V_MOV_B32_e32 7, implicit $exec
|
|
|
|
|
|
|
|
BUFFER_STORE_DWORD_OFFEN %1:vgpr_32, %0:vgpr_32, $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, 0, 0, 0, 0, implicit $exec
|
|
|
|
%2:vgpr_32 = BUFFER_LOAD_DWORD_OFFEN %0:vgpr_32, $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, 0, 0, 0, 0, implicit $exec
|
|
|
|
$vgpr0 = COPY %2
|
|
|
|
S_ENDPGM 0, implicit $vgpr0
|
|
|
|
|
|
|
|
...
|
|
|
|
|
|
|
|
---
|
|
|
|
name: function_fold_fi_mubuf_stack_relative
|
|
|
|
tracksRegLiveness: true
|
|
|
|
frameInfo:
|
|
|
|
maxAlignment: 4
|
|
|
|
localFrameSize: 4
|
|
|
|
stack:
|
|
|
|
- { id: 0, size: 4, alignment: 4, local-offset: 0 }
|
|
|
|
machineFunctionInfo:
|
|
|
|
isEntryFunction: false
|
2019-06-24 22:53:56 +08:00
|
|
|
scratchRSrcReg: '$sgpr0_sgpr1_sgpr2_sgpr3'
|
2020-01-22 06:27:57 +08:00
|
|
|
frameOffsetReg: '$sgpr32'
|
2019-06-24 22:53:56 +08:00
|
|
|
stackPtrOffsetReg: '$sgpr32'
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
|
2020-01-22 06:27:57 +08:00
|
|
|
; GCN-LABEL: name: function_fold_fi_mubuf_stack_relative
|
2019-06-24 22:53:56 +08:00
|
|
|
; GCN: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 7, implicit $exec
|
[AMDGPU] Extend buffer intrinsics with swizzling
Summary:
Extend cachepolicy operand in the new VMEM buffer intrinsics
to supply information whether the buffer data is swizzled.
Also, propagate this information to MIR.
Intrinsics updated:
int_amdgcn_raw_buffer_load
int_amdgcn_raw_buffer_load_format
int_amdgcn_raw_buffer_store
int_amdgcn_raw_buffer_store_format
int_amdgcn_raw_tbuffer_load
int_amdgcn_raw_tbuffer_store
int_amdgcn_struct_buffer_load
int_amdgcn_struct_buffer_load_format
int_amdgcn_struct_buffer_store
int_amdgcn_struct_buffer_store_format
int_amdgcn_struct_tbuffer_load
int_amdgcn_struct_tbuffer_store
Furthermore, disable merging of VMEM buffer instructions
in SI Load/Store optimizer, if the "swizzled" bit on the instruction
is on.
The default value of the bit is 0, meaning that data in buffer
is linear and buffer instructions can be merged.
There is no difference in the generated code with this commit.
However, in the future it will be expected that front-ends
use buffer intrinsics with correct "swizzled" bit set.
Reviewers: arsenm, nhaehnle, tpr
Reviewed By: nhaehnle
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, arphaman, jfb, Petar.Avramovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68200
llvm-svn: 373491
2019-10-03 01:22:36 +08:00
|
|
|
; GCN: BUFFER_STORE_DWORD_OFFEN [[V_MOV_B32_e32_]], %stack.0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr32, 0, 0, 0, 0, 0, 0, implicit $exec
|
|
|
|
; GCN: [[BUFFER_LOAD_DWORD_OFFEN:%[0-9]+]]:vgpr_32 = BUFFER_LOAD_DWORD_OFFEN %stack.0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr32, 0, 0, 0, 0, 0, 0, implicit $exec
|
2019-06-24 22:53:56 +08:00
|
|
|
; GCN: $vgpr0 = COPY [[BUFFER_LOAD_DWORD_OFFEN]]
|
|
|
|
; GCN: S_ENDPGM 0, implicit $vgpr0
|
|
|
|
%0:vgpr_32 = V_MOV_B32_e32 %stack.0, implicit $exec
|
|
|
|
%1:vgpr_32 = V_MOV_B32_e32 7, implicit $exec
|
|
|
|
|
[AMDGPU] Extend buffer intrinsics with swizzling
Summary:
Extend cachepolicy operand in the new VMEM buffer intrinsics
to supply information whether the buffer data is swizzled.
Also, propagate this information to MIR.
Intrinsics updated:
int_amdgcn_raw_buffer_load
int_amdgcn_raw_buffer_load_format
int_amdgcn_raw_buffer_store
int_amdgcn_raw_buffer_store_format
int_amdgcn_raw_tbuffer_load
int_amdgcn_raw_tbuffer_store
int_amdgcn_struct_buffer_load
int_amdgcn_struct_buffer_load_format
int_amdgcn_struct_buffer_store
int_amdgcn_struct_buffer_store_format
int_amdgcn_struct_tbuffer_load
int_amdgcn_struct_tbuffer_store
Furthermore, disable merging of VMEM buffer instructions
in SI Load/Store optimizer, if the "swizzled" bit on the instruction
is on.
The default value of the bit is 0, meaning that data in buffer
is linear and buffer instructions can be merged.
There is no difference in the generated code with this commit.
However, in the future it will be expected that front-ends
use buffer intrinsics with correct "swizzled" bit set.
Reviewers: arsenm, nhaehnle, tpr
Reviewed By: nhaehnle
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, arphaman, jfb, Petar.Avramovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68200
llvm-svn: 373491
2019-10-03 01:22:36 +08:00
|
|
|
BUFFER_STORE_DWORD_OFFEN %1:vgpr_32, %0:vgpr_32, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr32, 0, 0, 0, 0, 0, 0, implicit $exec
|
|
|
|
%2:vgpr_32 = BUFFER_LOAD_DWORD_OFFEN %0:vgpr_32, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr32, 0, 0, 0, 0, 0, 0, implicit $exec
|
2019-06-24 22:53:56 +08:00
|
|
|
$vgpr0 = COPY %2
|
|
|
|
S_ENDPGM 0, implicit $vgpr0
|
|
|
|
|
|
|
|
...
|