2018-02-23 18:45:56 +08:00
|
|
|
# RUN: llc -march=amdgcn -verify-machineinstrs -run-pass si-load-store-opt -o - %s | FileCheck %s
|
|
|
|
|
|
|
|
# Check that SILoadStoreOptimizer honors physregs defs/uses between moved
|
|
|
|
# instructions.
|
|
|
|
#
|
|
|
|
# The following IR snippet would usually be optimized by the peephole optimizer.
|
|
|
|
# However, an equivalent situation can occur with buffer instructions as well.
|
|
|
|
|
|
|
|
# CHECK-LABEL: name: scc_def_and_use_no_dependency
|
|
|
|
# CHECK: S_ADD_U32
|
|
|
|
# CHECK: S_ADDC_U32
|
|
|
|
# CHECK: DS_READ2_B32
|
|
|
|
---
|
|
|
|
name: scc_def_and_use_no_dependency
|
2019-10-15 02:30:29 +08:00
|
|
|
machineFunctionInfo:
|
|
|
|
isEntryFunction: true
|
2018-02-23 18:45:56 +08:00
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $vgpr0, $sgpr0
|
|
|
|
|
|
|
|
%1:vgpr_32 = COPY $vgpr0
|
|
|
|
%10:sgpr_32 = COPY $sgpr0
|
|
|
|
|
|
|
|
$m0 = S_MOV_B32 -1
|
2019-10-15 02:30:29 +08:00
|
|
|
%2:vgpr_32 = DS_READ_B32 %1, 0, 0, implicit $m0, implicit $exec :: (load 4)
|
2018-02-23 18:45:56 +08:00
|
|
|
|
|
|
|
%11:sgpr_32 = S_ADD_U32 %10, 4, implicit-def $scc
|
|
|
|
%12:sgpr_32 = S_ADDC_U32 %10, 0, implicit-def dead $scc, implicit $scc
|
|
|
|
|
2019-10-15 02:30:29 +08:00
|
|
|
%3:vgpr_32 = DS_READ_B32 %1, 64, 0, implicit $m0, implicit $exec :: (load 4)
|
[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
|
2018-02-23 18:45:56 +08:00
|
|
|
|
|
|
|
...
|
|
|
|
|
|
|
|
# CHECK-LABEL: name: scc_def_and_use_dependency
|
|
|
|
# CHECK: DS_READ2_B32
|
|
|
|
# CHECK: S_ADD_U32
|
|
|
|
# CHECK: S_ADDC_U32
|
|
|
|
---
|
|
|
|
name: scc_def_and_use_dependency
|
2019-10-15 02:30:29 +08:00
|
|
|
machineFunctionInfo:
|
|
|
|
isEntryFunction: true
|
|
|
|
|
2018-02-23 18:45:56 +08:00
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $vgpr0, $sgpr0
|
|
|
|
|
|
|
|
%1:vgpr_32 = COPY $vgpr0
|
|
|
|
%10:sgpr_32 = COPY $sgpr0
|
|
|
|
|
|
|
|
$m0 = S_MOV_B32 -1
|
2019-10-15 02:30:29 +08:00
|
|
|
%2:vgpr_32 = DS_READ_B32 %1, 0, 0, implicit $m0, implicit $exec :: (load 4)
|
2018-02-23 18:45:56 +08:00
|
|
|
%20:sgpr_32 = V_READFIRSTLANE_B32 %2, implicit $exec
|
|
|
|
|
|
|
|
%21:sgpr_32 = S_ADD_U32 %20, 4, implicit-def $scc
|
|
|
|
; The S_ADDC_U32 depends on the first DS_READ_B32 only via SCC
|
|
|
|
%11:sgpr_32 = S_ADDC_U32 %10, 0, implicit-def dead $scc, implicit $scc
|
|
|
|
|
2019-10-15 02:30:29 +08:00
|
|
|
%3:vgpr_32 = DS_READ_B32 %1, 64, 0, implicit $m0, implicit $exec :: (load 4)
|
[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
|
2018-02-23 18:45:56 +08:00
|
|
|
|
|
|
|
...
|