2017-04-25 03:37:54 +08:00
|
|
|
# RUN: llc -march=amdgcn -amdgpu-enable-merge-m0 -verify-machineinstrs -run-pass si-fix-sgpr-copies %s -o - | FileCheck -check-prefix=GCN %s
|
|
|
|
|
AMDGPU: Move m0 initializations earlier
Summary:
After hoisting and merging m0 initializations schedule them as early as
possible in the MBB. This helps the scheduler avoid hazards in some
cases.
Reviewers: rampitec, arsenm
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, arphaman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67450
llvm-svn: 371671
2019-09-12 05:28:41 +08:00
|
|
|
# GCN-LABEL: name: merge-m0-many-init
|
2017-04-25 03:37:54 +08:00
|
|
|
# GCN: bb.0.entry:
|
|
|
|
# GCN: SI_INIT_M0 -1
|
AMDGPU: Move m0 initializations earlier
Summary:
After hoisting and merging m0 initializations schedule them as early as
possible in the MBB. This helps the scheduler avoid hazards in some
cases.
Reviewers: rampitec, arsenm
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, arphaman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67450
llvm-svn: 371671
2019-09-12 05:28:41 +08:00
|
|
|
# GCN-NEXT: IMPLICIT_DEF
|
|
|
|
# GCN-NEXT: IMPLICIT_DEF
|
2017-04-25 03:37:54 +08:00
|
|
|
# GCN-NEXT: DS_WRITE_B32
|
|
|
|
# GCN-NEXT: DS_WRITE_B32
|
|
|
|
# GCN-NEXT: SI_INIT_M0 65536
|
|
|
|
# GCN-NEXT: DS_WRITE_B32
|
|
|
|
# GCN-NEXT: DS_WRITE_B32
|
|
|
|
# GCN-NEXT: SI_INIT_M0 -1
|
|
|
|
# GCN-NEXT: DS_WRITE_B32
|
|
|
|
# GCN-NEXT: SI_INIT_M0 65536
|
|
|
|
# GCN-NEXT: DS_WRITE_B32
|
|
|
|
|
|
|
|
# GCN: bb.1:
|
|
|
|
# GCN: SI_INIT_M0 -1
|
|
|
|
# GCN-NEXT: DS_WRITE_B32
|
|
|
|
# GCN-NEXT: DS_WRITE_B32
|
|
|
|
|
|
|
|
# GCN: bb.2:
|
|
|
|
# GCN: SI_INIT_M0 65536
|
|
|
|
# GCN-NEXT: DS_WRITE_B32
|
|
|
|
|
|
|
|
# GCN: bb.3:
|
|
|
|
# GCN: SI_INIT_M0 3
|
|
|
|
|
|
|
|
# GCN: bb.4:
|
|
|
|
# GCN-NOT: SI_INIT_M0
|
|
|
|
# GCN: DS_WRITE_B32
|
|
|
|
# GCN-NEXT: SI_INIT_M0 4
|
|
|
|
# GCN-NEXT: DS_WRITE_B32
|
|
|
|
|
|
|
|
# GCN: bb.5:
|
|
|
|
# GCN-NOT: SI_INIT_M0
|
|
|
|
# GCN: DS_WRITE_B32
|
|
|
|
# GCN-NEXT: SI_INIT_M0 4
|
|
|
|
# GCN-NEXT: DS_WRITE_B32
|
|
|
|
|
|
|
|
# GCN: bb.6:
|
|
|
|
# GCN: SI_INIT_M0 -1,
|
|
|
|
# GCN-NEXT: DS_WRITE_B32
|
|
|
|
# GCN: SI_INIT_M0 %2
|
|
|
|
# GCN-NEXT: DS_WRITE_B32
|
|
|
|
# GCN-NEXT: SI_INIT_M0 %2
|
|
|
|
# GCN-NEXT: DS_WRITE_B32
|
|
|
|
# GCN-NEXT: SI_INIT_M0 -1
|
|
|
|
# GCN-NEXT: DS_WRITE_B32
|
|
|
|
---
|
AMDGPU: Move m0 initializations earlier
Summary:
After hoisting and merging m0 initializations schedule them as early as
possible in the MBB. This helps the scheduler avoid hazards in some
cases.
Reviewers: rampitec, arsenm
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, arphaman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67450
llvm-svn: 371671
2019-09-12 05:28:41 +08:00
|
|
|
name: merge-m0-many-init
|
2017-04-25 03:37:54 +08:00
|
|
|
registers:
|
|
|
|
- { id: 0, class: vgpr_32 }
|
|
|
|
- { id: 1, class: vgpr_32 }
|
|
|
|
- { id: 2, class: sreg_32_xm0 }
|
|
|
|
body: |
|
|
|
|
bb.0.entry:
|
|
|
|
successors: %bb.1, %bb.2
|
|
|
|
|
|
|
|
%0 = IMPLICIT_DEF
|
|
|
|
%1 = IMPLICIT_DEF
|
2018-02-01 06:04:26 +08:00
|
|
|
SI_INIT_M0 -1, implicit-def $m0
|
|
|
|
DS_WRITE_B32 %0, %1, 0, 0, implicit $m0, implicit $exec
|
|
|
|
SI_INIT_M0 -1, implicit-def $m0
|
|
|
|
DS_WRITE_B32 %0, %1, 0, 0, implicit $m0, implicit $exec
|
|
|
|
SI_INIT_M0 65536, implicit-def $m0
|
|
|
|
DS_WRITE_B32 %0, %1, 0, 0, implicit $m0, implicit $exec
|
|
|
|
SI_INIT_M0 65536, implicit-def $m0
|
|
|
|
DS_WRITE_B32 %0, %1, 0, 0, implicit $m0, implicit $exec
|
|
|
|
SI_INIT_M0 -1, implicit-def $m0
|
|
|
|
DS_WRITE_B32 %0, %1, 0, 0, implicit $m0, implicit $exec
|
|
|
|
SI_INIT_M0 65536, implicit-def $m0
|
|
|
|
DS_WRITE_B32 %0, %1, 0, 0, implicit $m0, implicit $exec
|
|
|
|
S_CBRANCH_VCCZ %bb.1, implicit undef $vcc
|
2017-04-25 03:37:54 +08:00
|
|
|
S_BRANCH %bb.2
|
|
|
|
|
|
|
|
bb.1:
|
|
|
|
successors: %bb.2
|
2018-02-01 06:04:26 +08:00
|
|
|
SI_INIT_M0 -1, implicit-def $m0
|
|
|
|
DS_WRITE_B32 %0, %1, 0, 0, implicit $m0, implicit $exec
|
|
|
|
SI_INIT_M0 -1, implicit-def $m0
|
|
|
|
DS_WRITE_B32 %0, %1, 0, 0, implicit $m0, implicit $exec
|
2017-04-25 03:37:54 +08:00
|
|
|
S_BRANCH %bb.2
|
|
|
|
|
|
|
|
bb.2:
|
|
|
|
successors: %bb.3
|
2018-02-01 06:04:26 +08:00
|
|
|
SI_INIT_M0 65536, implicit-def $m0
|
|
|
|
DS_WRITE_B32 %0, %1, 0, 0, implicit $m0, implicit $exec
|
2017-04-25 03:37:54 +08:00
|
|
|
S_BRANCH %bb.3
|
|
|
|
|
|
|
|
bb.3:
|
|
|
|
successors: %bb.4, %bb.5
|
2018-02-01 06:04:26 +08:00
|
|
|
S_CBRANCH_VCCZ %bb.4, implicit undef $vcc
|
2017-04-25 03:37:54 +08:00
|
|
|
S_BRANCH %bb.5
|
|
|
|
|
|
|
|
bb.4:
|
|
|
|
successors: %bb.6
|
2018-02-01 06:04:26 +08:00
|
|
|
SI_INIT_M0 3, implicit-def $m0
|
|
|
|
DS_WRITE_B32 %0, %1, 0, 0, implicit $m0, implicit $exec
|
|
|
|
SI_INIT_M0 4, implicit-def $m0
|
|
|
|
DS_WRITE_B32 %0, %1, 0, 0, implicit $m0, implicit $exec
|
2017-04-25 03:37:54 +08:00
|
|
|
S_BRANCH %bb.6
|
|
|
|
|
|
|
|
bb.5:
|
|
|
|
successors: %bb.6
|
2018-02-01 06:04:26 +08:00
|
|
|
SI_INIT_M0 3, implicit-def $m0
|
|
|
|
DS_WRITE_B32 %0, %1, 0, 0, implicit $m0, implicit $exec
|
|
|
|
SI_INIT_M0 4, implicit-def $m0
|
|
|
|
DS_WRITE_B32 %0, %1, 0, 0, implicit $m0, implicit $exec
|
2017-04-25 03:37:54 +08:00
|
|
|
S_BRANCH %bb.6
|
|
|
|
|
|
|
|
bb.6:
|
|
|
|
successors: %bb.0.entry, %bb.6
|
2018-02-01 06:04:26 +08:00
|
|
|
SI_INIT_M0 -1, implicit-def $m0
|
|
|
|
DS_WRITE_B32 %0, %1, 0, 0, implicit $m0, implicit $exec
|
2017-04-25 03:37:54 +08:00
|
|
|
%2 = IMPLICIT_DEF
|
2018-02-01 06:04:26 +08:00
|
|
|
SI_INIT_M0 %2, implicit-def $m0
|
|
|
|
DS_WRITE_B32 %0, %1, 0, 0, implicit $m0, implicit $exec
|
|
|
|
SI_INIT_M0 %2, implicit-def $m0
|
|
|
|
DS_WRITE_B32 %0, %1, 0, 0, implicit $m0, implicit $exec
|
|
|
|
SI_INIT_M0 -1, implicit-def $m0
|
|
|
|
DS_WRITE_B32 %0, %1, 0, 0, implicit $m0, implicit $exec
|
|
|
|
S_CBRANCH_VCCZ %bb.6, implicit undef $vcc
|
2017-04-25 03:37:54 +08:00
|
|
|
S_BRANCH %bb.0.entry
|
|
|
|
|
|
|
|
...
|
[AMDGPU] Enable merging m0 initializations.
Summary:
Enable hoisting and merging m0 defs that are initialized with the same
immediate value. Fixes bug where removed instructions are not considered
to interfere with other inits, and make sure to not hoist inits before block
prologues.
Reviewers: rampitec, arsenm
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64766
llvm-svn: 366135
2019-07-16 06:07:05 +08:00
|
|
|
|
AMDGPU: Move m0 initializations earlier
Summary:
After hoisting and merging m0 initializations schedule them as early as
possible in the MBB. This helps the scheduler avoid hazards in some
cases.
Reviewers: rampitec, arsenm
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, arphaman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67450
llvm-svn: 371671
2019-09-12 05:28:41 +08:00
|
|
|
# GCN-LABEL: name: merge-m0-dont-hoist-past-init-with-different-initializer
|
[AMDGPU] Enable merging m0 initializations.
Summary:
Enable hoisting and merging m0 defs that are initialized with the same
immediate value. Fixes bug where removed instructions are not considered
to interfere with other inits, and make sure to not hoist inits before block
prologues.
Reviewers: rampitec, arsenm
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64766
llvm-svn: 366135
2019-07-16 06:07:05 +08:00
|
|
|
# GCN: bb.0.entry:
|
|
|
|
# GCN: SI_INIT_M0 65536
|
AMDGPU: Move m0 initializations earlier
Summary:
After hoisting and merging m0 initializations schedule them as early as
possible in the MBB. This helps the scheduler avoid hazards in some
cases.
Reviewers: rampitec, arsenm
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, arphaman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67450
llvm-svn: 371671
2019-09-12 05:28:41 +08:00
|
|
|
# GCN-NEXT: IMPLICIT_DEF
|
|
|
|
# GCN-NEXT: IMPLICIT_DEF
|
[AMDGPU] Enable merging m0 initializations.
Summary:
Enable hoisting and merging m0 defs that are initialized with the same
immediate value. Fixes bug where removed instructions are not considered
to interfere with other inits, and make sure to not hoist inits before block
prologues.
Reviewers: rampitec, arsenm
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64766
llvm-svn: 366135
2019-07-16 06:07:05 +08:00
|
|
|
# GCN-NEXT: DS_WRITE_B32
|
|
|
|
|
AMDGPU: Move m0 initializations earlier
Summary:
After hoisting and merging m0 initializations schedule them as early as
possible in the MBB. This helps the scheduler avoid hazards in some
cases.
Reviewers: rampitec, arsenm
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, arphaman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67450
llvm-svn: 371671
2019-09-12 05:28:41 +08:00
|
|
|
# GCN: bb.1:
|
|
|
|
# GCN-NOT: SI_INIT_M0 65536
|
|
|
|
# GCN-NOT: SI_INIT_M0 -1
|
[AMDGPU] Enable merging m0 initializations.
Summary:
Enable hoisting and merging m0 defs that are initialized with the same
immediate value. Fixes bug where removed instructions are not considered
to interfere with other inits, and make sure to not hoist inits before block
prologues.
Reviewers: rampitec, arsenm
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64766
llvm-svn: 366135
2019-07-16 06:07:05 +08:00
|
|
|
|
AMDGPU: Move m0 initializations earlier
Summary:
After hoisting and merging m0 initializations schedule them as early as
possible in the MBB. This helps the scheduler avoid hazards in some
cases.
Reviewers: rampitec, arsenm
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, arphaman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67450
llvm-svn: 371671
2019-09-12 05:28:41 +08:00
|
|
|
# GCN: bb.2:
|
|
|
|
# GCN: SI_INIT_M0 -1
|
[AMDGPU] Enable merging m0 initializations.
Summary:
Enable hoisting and merging m0 defs that are initialized with the same
immediate value. Fixes bug where removed instructions are not considered
to interfere with other inits, and make sure to not hoist inits before block
prologues.
Reviewers: rampitec, arsenm
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64766
llvm-svn: 366135
2019-07-16 06:07:05 +08:00
|
|
|
|
AMDGPU: Move m0 initializations earlier
Summary:
After hoisting and merging m0 initializations schedule them as early as
possible in the MBB. This helps the scheduler avoid hazards in some
cases.
Reviewers: rampitec, arsenm
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, arphaman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67450
llvm-svn: 371671
2019-09-12 05:28:41 +08:00
|
|
|
# GCN: bb.3:
|
|
|
|
# GCN: SI_INIT_M0 -1
|
[AMDGPU] Enable merging m0 initializations.
Summary:
Enable hoisting and merging m0 defs that are initialized with the same
immediate value. Fixes bug where removed instructions are not considered
to interfere with other inits, and make sure to not hoist inits before block
prologues.
Reviewers: rampitec, arsenm
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64766
llvm-svn: 366135
2019-07-16 06:07:05 +08:00
|
|
|
---
|
AMDGPU: Move m0 initializations earlier
Summary:
After hoisting and merging m0 initializations schedule them as early as
possible in the MBB. This helps the scheduler avoid hazards in some
cases.
Reviewers: rampitec, arsenm
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, arphaman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67450
llvm-svn: 371671
2019-09-12 05:28:41 +08:00
|
|
|
name: merge-m0-dont-hoist-past-init-with-different-initializer
|
[AMDGPU] Enable merging m0 initializations.
Summary:
Enable hoisting and merging m0 defs that are initialized with the same
immediate value. Fixes bug where removed instructions are not considered
to interfere with other inits, and make sure to not hoist inits before block
prologues.
Reviewers: rampitec, arsenm
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64766
llvm-svn: 366135
2019-07-16 06:07:05 +08:00
|
|
|
registers:
|
|
|
|
- { id: 0, class: vgpr_32 }
|
|
|
|
- { id: 1, class: vgpr_32 }
|
|
|
|
body: |
|
|
|
|
bb.0.entry:
|
|
|
|
successors: %bb.1
|
|
|
|
|
|
|
|
%0 = IMPLICIT_DEF
|
|
|
|
%1 = IMPLICIT_DEF
|
|
|
|
SI_INIT_M0 65536, implicit-def $m0
|
|
|
|
DS_WRITE_B32 %0, %1, 0, 0, implicit $m0, implicit $exec
|
|
|
|
S_BRANCH %bb.1
|
|
|
|
|
|
|
|
bb.1:
|
|
|
|
successors: %bb.2, %bb.3
|
|
|
|
|
|
|
|
SI_INIT_M0 65536, implicit-def $m0
|
|
|
|
DS_WRITE_B32 %0, %1, 0, 0, implicit $m0, implicit $exec
|
|
|
|
S_CBRANCH_VCCZ %bb.2, implicit undef $vcc
|
|
|
|
S_BRANCH %bb.3
|
|
|
|
|
|
|
|
bb.2:
|
|
|
|
successors: %bb.4
|
|
|
|
|
|
|
|
SI_INIT_M0 -1, implicit-def $m0
|
|
|
|
DS_WRITE_B32 %0, %1, 0, 0, implicit $m0, implicit $exec
|
|
|
|
S_BRANCH %bb.4
|
|
|
|
|
|
|
|
bb.3:
|
|
|
|
successors: %bb.4
|
|
|
|
|
|
|
|
SI_INIT_M0 -1, implicit-def $m0
|
|
|
|
DS_WRITE_B32 %0, %1, 0, 0, implicit $m0, implicit $exec
|
|
|
|
S_BRANCH %bb.4
|
|
|
|
|
|
|
|
bb.4:
|
|
|
|
S_ENDPGM 0
|
|
|
|
...
|
|
|
|
|
AMDGPU: Move m0 initializations earlier
Summary:
After hoisting and merging m0 initializations schedule them as early as
possible in the MBB. This helps the scheduler avoid hazards in some
cases.
Reviewers: rampitec, arsenm
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, arphaman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67450
llvm-svn: 371671
2019-09-12 05:28:41 +08:00
|
|
|
# GCN-LABEL: name: merge-m0-after-prologue
|
[AMDGPU] Enable merging m0 initializations.
Summary:
Enable hoisting and merging m0 defs that are initialized with the same
immediate value. Fixes bug where removed instructions are not considered
to interfere with other inits, and make sure to not hoist inits before block
prologues.
Reviewers: rampitec, arsenm
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64766
llvm-svn: 366135
2019-07-16 06:07:05 +08:00
|
|
|
# GCN: bb.0.entry:
|
|
|
|
# GCN-NOT: SI_INIT_M0
|
|
|
|
# GCN: S_OR_B64
|
|
|
|
# GCN-NEXT: SI_INIT_M0
|
|
|
|
|
AMDGPU: Move m0 initializations earlier
Summary:
After hoisting and merging m0 initializations schedule them as early as
possible in the MBB. This helps the scheduler avoid hazards in some
cases.
Reviewers: rampitec, arsenm
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, arphaman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67450
llvm-svn: 371671
2019-09-12 05:28:41 +08:00
|
|
|
# GCN: bb.1:
|
|
|
|
# GCN-NOT: SI_INIT_M0 -1
|
[AMDGPU] Enable merging m0 initializations.
Summary:
Enable hoisting and merging m0 defs that are initialized with the same
immediate value. Fixes bug where removed instructions are not considered
to interfere with other inits, and make sure to not hoist inits before block
prologues.
Reviewers: rampitec, arsenm
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64766
llvm-svn: 366135
2019-07-16 06:07:05 +08:00
|
|
|
|
AMDGPU: Move m0 initializations earlier
Summary:
After hoisting and merging m0 initializations schedule them as early as
possible in the MBB. This helps the scheduler avoid hazards in some
cases.
Reviewers: rampitec, arsenm
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, arphaman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67450
llvm-svn: 371671
2019-09-12 05:28:41 +08:00
|
|
|
# GCN: bb.2:
|
|
|
|
# GCN-NOT: SI_INIT_MO -1
|
[AMDGPU] Enable merging m0 initializations.
Summary:
Enable hoisting and merging m0 defs that are initialized with the same
immediate value. Fixes bug where removed instructions are not considered
to interfere with other inits, and make sure to not hoist inits before block
prologues.
Reviewers: rampitec, arsenm
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64766
llvm-svn: 366135
2019-07-16 06:07:05 +08:00
|
|
|
---
|
AMDGPU: Move m0 initializations earlier
Summary:
After hoisting and merging m0 initializations schedule them as early as
possible in the MBB. This helps the scheduler avoid hazards in some
cases.
Reviewers: rampitec, arsenm
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, arphaman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67450
llvm-svn: 371671
2019-09-12 05:28:41 +08:00
|
|
|
name: merge-m0-after-prologue
|
[AMDGPU] Enable merging m0 initializations.
Summary:
Enable hoisting and merging m0 defs that are initialized with the same
immediate value. Fixes bug where removed instructions are not considered
to interfere with other inits, and make sure to not hoist inits before block
prologues.
Reviewers: rampitec, arsenm
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64766
llvm-svn: 366135
2019-07-16 06:07:05 +08:00
|
|
|
registers:
|
|
|
|
- { id: 0, class: vgpr_32 }
|
|
|
|
- { id: 1, class: vgpr_32 }
|
|
|
|
body: |
|
|
|
|
bb.0.entry:
|
|
|
|
successors: %bb.1, %bb.2
|
|
|
|
liveins: $sgpr0_sgpr1
|
|
|
|
|
|
|
|
$exec = S_OR_B64 $exec, killed $sgpr0_sgpr1, implicit-def $scc
|
|
|
|
%0 = IMPLICIT_DEF
|
|
|
|
%1 = IMPLICIT_DEF
|
|
|
|
S_CBRANCH_VCCZ %bb.1, implicit undef $vcc
|
|
|
|
S_BRANCH %bb.2
|
|
|
|
|
|
|
|
bb.1:
|
|
|
|
successors: %bb.3
|
|
|
|
|
|
|
|
SI_INIT_M0 -1, implicit-def $m0
|
|
|
|
DS_WRITE_B32 %0, %1, 0, 0, implicit $m0, implicit $exec
|
|
|
|
S_BRANCH %bb.3
|
|
|
|
|
|
|
|
bb.2:
|
|
|
|
successors: %bb.3
|
|
|
|
|
|
|
|
SI_INIT_M0 -1, implicit-def $m0
|
|
|
|
DS_WRITE_B32 %0, %1, 0, 0, implicit $m0, implicit $exec
|
|
|
|
S_BRANCH %bb.3
|
|
|
|
|
|
|
|
bb.3:
|
|
|
|
S_ENDPGM 0
|
|
|
|
...
|
AMDGPU: Move m0 initializations earlier
Summary:
After hoisting and merging m0 initializations schedule them as early as
possible in the MBB. This helps the scheduler avoid hazards in some
cases.
Reviewers: rampitec, arsenm
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, arphaman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67450
llvm-svn: 371671
2019-09-12 05:28:41 +08:00
|
|
|
|
|
|
|
# GCN-LABEL: name: move-m0-avoid-hazard
|
|
|
|
# GCN: $m0 = S_MOV_B32 -1
|
|
|
|
# GCN-NEXT: $vgpr0 = V_MOV_B32_e32 0, implicit $exec
|
|
|
|
# GCN-NEXT: DS_GWS_INIT $vgpr0, 0, 1, implicit $m0, implicit $exec
|
|
|
|
---
|
|
|
|
name: move-m0-avoid-hazard
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
$vgpr0 = V_MOV_B32_e32 0, implicit $exec
|
|
|
|
$m0 = S_MOV_B32 -1
|
|
|
|
DS_GWS_INIT $vgpr0, 0, 1, implicit $m0, implicit $exec
|
|
|
|
...
|
|
|
|
|
|
|
|
# GCN-LABEL: name: move-m0-with-prologue
|
|
|
|
# GCN $exec = S_OR_B64 $exec, killed $sgpr0_sgpr1, implicit-def $scc
|
|
|
|
# GCN: $m0 = S_MOV_B32 -1
|
|
|
|
# GCN-NEXT: $vgpr0 = V_MOV_B32_e32 0, implicit $exec
|
|
|
|
# GCN-NEXT: DS_GWS_INIT $vgpr0, 0, 1, implicit $m0, implicit $exec
|
|
|
|
---
|
|
|
|
name: move-m0-with-prologue
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $sgpr0_sgpr1
|
|
|
|
|
|
|
|
$exec = S_OR_B64 $exec, killed $sgpr0_sgpr1, implicit-def $scc
|
|
|
|
$vgpr0 = V_MOV_B32_e32 0, implicit $exec
|
|
|
|
$m0 = S_MOV_B32 -1
|
|
|
|
DS_GWS_INIT $vgpr0, 0, 1, implicit $m0, implicit $exec
|
|
|
|
...
|
|
|
|
|
|
|
|
# GCN-LABEL: name: move-m0-different-initializer
|
|
|
|
# GCN: SI_INIT_M0 -1
|
|
|
|
# GCN-NEXT: %0:vgpr_32 = IMPLICIT_DEF
|
|
|
|
# GCN: SI_INIT_M0 65536
|
|
|
|
# GCN-NEXT: S_NOP
|
|
|
|
---
|
|
|
|
name: move-m0-different-initializer
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: vgpr_32 }
|
|
|
|
- { id: 1, class: vgpr_32 }
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
%0 = IMPLICIT_DEF
|
|
|
|
%1 = IMPLICIT_DEF
|
|
|
|
SI_INIT_M0 -1, implicit-def $m0
|
|
|
|
DS_WRITE_B32 %0, %1, 0, 0, implicit $m0, implicit $exec
|
|
|
|
S_NOP 0
|
|
|
|
SI_INIT_M0 65536, implicit-def $m0
|
|
|
|
DS_WRITE_B32 %0, %1, 0, 0, implicit $m0, implicit $exec
|
|
|
|
...
|
|
|
|
|
|
|
|
# GCN-LABEL: name: move-m0-schedule-boundary
|
|
|
|
# GCN: S_SETREG
|
|
|
|
# GCN-NEXT: SI_INIT_M0 -1
|
|
|
|
---
|
|
|
|
name: move-m0-schedule-boundary
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: vgpr_32 }
|
|
|
|
- { id: 1, class: vgpr_32 }
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
%0 = IMPLICIT_DEF
|
|
|
|
%1 = IMPLICIT_DEF
|
|
|
|
S_SETREG_IMM32_B32 0, 1
|
|
|
|
SI_INIT_M0 -1, implicit-def $m0
|
|
|
|
DS_WRITE_B32 %0, %1, 0, 0, implicit $m0, implicit $exec
|
|
|
|
...
|