2019-03-28 01:31:29 +08:00
|
|
|
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
|
|
|
|
# RUN: llc -mtriple=amdgcn-amd-amdhsa -verify-machineinstrs -run-pass=prologepilog %s -o - | FileCheck %s
|
|
|
|
|
|
|
|
# The wrong form of scavengeRegister was used, so it wasn't accounting
|
|
|
|
# for the iterator passed to eliminateFrameIndex. It was instead using
|
|
|
|
# the current iterator in the scavenger, which was not yet set if the
|
|
|
|
# spill was the first instruction in the block.
|
|
|
|
|
|
|
|
---
|
|
|
|
name: scavenge_register_position
|
|
|
|
tracksRegLiveness: true
|
|
|
|
|
|
|
|
# Force a frame larger than the immediate field with a large alignment.
|
|
|
|
stack:
|
|
|
|
- { id: 0, type: default, offset: 4096, size: 4, alignment: 8192 }
|
|
|
|
|
|
|
|
machineFunctionInfo:
|
|
|
|
isEntryFunction: true
|
|
|
|
scratchRSrcReg: $sgpr0_sgpr1_sgpr2_sgpr3
|
2019-06-21 05:58:24 +08:00
|
|
|
scratchWaveOffsetReg: $sgpr33
|
2019-03-28 01:31:29 +08:00
|
|
|
frameOffsetReg: $sgpr5
|
2019-06-06 06:20:47 +08:00
|
|
|
stackPtrOffsetReg: $sgpr32
|
2019-03-28 01:31:29 +08:00
|
|
|
|
|
|
|
body: |
|
|
|
|
; CHECK-LABEL: name: scavenge_register_position
|
|
|
|
; CHECK: bb.0:
|
|
|
|
; CHECK: successors: %bb.1(0x80000000)
|
2019-06-21 05:58:24 +08:00
|
|
|
; CHECK: liveins: $sgpr33, $sgpr0_sgpr1_sgpr2_sgpr3
|
|
|
|
; CHECK: $sgpr4 = S_ADD_U32 $sgpr32, 524288, implicit-def $scc
|
[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
|
|
|
; CHECK: $vgpr0 = BUFFER_LOAD_DWORD_OFFSET $sgpr0_sgpr1_sgpr2_sgpr3, killed $sgpr4, 0, 0, 0, 0, 0, 0, implicit $exec :: (load 4 from %stack.0, align 8192, addrspace 5)
|
2019-03-28 01:31:29 +08:00
|
|
|
; CHECK: S_BRANCH %bb.1
|
|
|
|
; CHECK: bb.1:
|
2019-06-06 06:20:47 +08:00
|
|
|
; CHECK: liveins: $sgpr0_sgpr1_sgpr2_sgpr3
|
|
|
|
; CHECK: $sgpr4 = S_ADD_U32 $sgpr32, 524288, implicit-def $scc
|
[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
|
|
|
; CHECK: $vgpr0 = BUFFER_LOAD_DWORD_OFFSET $sgpr0_sgpr1_sgpr2_sgpr3, killed $sgpr4, 0, 0, 0, 0, 0, 0, implicit $exec :: (load 4 from %stack.0, align 8192, addrspace 5)
|
2019-03-28 01:31:29 +08:00
|
|
|
; CHECK: S_ENDPGM 0, implicit $vgpr0
|
|
|
|
bb.0:
|
2019-06-06 06:20:47 +08:00
|
|
|
$vgpr0 = SI_SPILL_V32_RESTORE %stack.0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr32, 0, implicit $exec :: (load 4 from %stack.0, addrspace 5)
|
2019-03-28 01:31:29 +08:00
|
|
|
S_BRANCH %bb.1
|
|
|
|
|
|
|
|
bb.1:
|
2019-06-06 06:20:47 +08:00
|
|
|
$vgpr0 = SI_SPILL_V32_RESTORE %stack.0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr32, 0, implicit $exec :: (load 4 from %stack.0, addrspace 5)
|
2019-03-28 01:31:29 +08:00
|
|
|
S_ENDPGM 0, implicit $vgpr0
|
|
|
|
...
|