2017-11-14 14:40:00 +08:00
|
|
|
# RUN: llc -mtriple=amdgcn--amdhsa -mcpu=gfx900 -run-pass si-optimize-exec-masking -verify-machineinstrs -o - %s | FileCheck %s
|
2017-11-14 10:16:54 +08:00
|
|
|
--- |
|
|
|
|
define amdgpu_kernel void @undefined_physreg_sgpr_spill() #0 {
|
|
|
|
unreachable
|
|
|
|
}
|
|
|
|
|
|
|
|
define amdgpu_kernel void @undefined_physreg_sgpr_spill_reorder() #0 {
|
|
|
|
unreachable
|
|
|
|
}
|
|
|
|
|
|
|
|
attributes #0 = { nounwind "amdgpu-num-sgpr"="16" }
|
|
|
|
|
|
|
|
...
|
|
|
|
---
|
|
|
|
|
|
|
|
# copy + s_and_b64 was turned into saveexec, deleting the copy,
|
|
|
|
# leaving a spill of the undefined register.
|
|
|
|
|
2017-11-14 14:40:00 +08:00
|
|
|
# CHECK-LABEL: name: undefined_physreg_sgpr_spill
|
2018-02-01 06:04:26 +08:00
|
|
|
# CHECK: $sgpr0_sgpr1 = COPY $exec, implicit-def $exec
|
|
|
|
# CHECK-NEXT: SI_SPILL_S64_SAVE $sgpr0_sgpr1,
|
|
|
|
# CHECK-NEXT: $sgpr2_sgpr3 = S_AND_B64 killed $sgpr0_sgpr1, killed $vcc, implicit-def dead $scc
|
|
|
|
# CHECK: $exec = COPY killed $sgpr2_sgpr3
|
2017-11-14 10:16:54 +08:00
|
|
|
name: undefined_physreg_sgpr_spill
|
[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-11-14 10:16:54 +08:00
|
|
|
exposesReturnsTwice: false
|
|
|
|
legalized: false
|
|
|
|
regBankSelected: false
|
|
|
|
selected: false
|
|
|
|
tracksRegLiveness: true
|
|
|
|
registers:
|
|
|
|
liveins:
|
2018-02-01 06:04:26 +08:00
|
|
|
- { reg: '$vgpr0', virtual-reg: '' }
|
|
|
|
- { reg: '$sgpr4_sgpr5', virtual-reg: '' }
|
2017-11-14 10:16:54 +08:00
|
|
|
stack:
|
|
|
|
- { id: 0, name: '', type: spill-slot, offset: 0, size: 8, alignment: 4,
|
2019-06-17 17:13:29 +08:00
|
|
|
stack-id: sgpr-spill, callee-saved-register: '', callee-saved-restored: true,
|
2018-04-26 02:58:06 +08:00
|
|
|
debug-info-variable: '', debug-info-expression: '',
|
|
|
|
debug-info-location: '' }
|
2017-11-14 10:16:54 +08:00
|
|
|
constants:
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
successors: %bb.1, %bb.2
|
[AMDGPU] Correct the setting of `FlatScratchInit`.
Summary: - That flag setting should skip spilling stack slot.
Reviewers: arsenm, rampitec
Subscribers: qcolombet, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64143
llvm-svn: 365137
2019-07-04 21:29:45 +08:00
|
|
|
liveins: $vgpr0, $sgpr4_sgpr5, $sgpr8_sgpr9_sgpr10_sgpr11, $sgpr13
|
2018-02-01 06:04:26 +08:00
|
|
|
|
|
|
|
$vgpr1_vgpr2 = COPY killed $sgpr4_sgpr5, implicit $exec
|
2019-05-01 06:08:23 +08:00
|
|
|
$vgpr1 = GLOBAL_LOAD_UBYTE killed $vgpr1_vgpr2, 0, 0, 0, 0, implicit $exec :: (non-temporal dereferenceable invariant load 1 from `i1 addrspace(4)* undef`)
|
2018-02-01 06:04:26 +08:00
|
|
|
$vcc = V_CMP_NE_U32_e64 0, $vgpr0, implicit $exec
|
|
|
|
$sgpr0_sgpr1 = V_CMP_EQ_U32_e64 1, killed $vgpr1, implicit $exec
|
2019-03-19 03:25:39 +08:00
|
|
|
$vgpr1 = V_CNDMASK_B32_e64 0, 0, 0, -1, killed $sgpr0_sgpr1, implicit $exec
|
2018-02-01 06:04:26 +08:00
|
|
|
$sgpr0_sgpr1 = COPY $exec, implicit-def $exec
|
2018-02-03 00:07:16 +08:00
|
|
|
SI_SPILL_S64_SAVE $sgpr0_sgpr1, %stack.0, implicit $exec, implicit $sgpr8_sgpr9_sgpr10_sgpr11, implicit $sgpr13, implicit-def dead $m0 :: (store 8 into %stack.0, align 4, addrspace 5)
|
2018-02-01 06:04:26 +08:00
|
|
|
$sgpr2_sgpr3 = S_AND_B64 killed $sgpr0_sgpr1, killed $vcc, implicit-def dead $scc
|
|
|
|
$exec = S_MOV_B64_term killed $sgpr2_sgpr3
|
|
|
|
SI_MASK_BRANCH %bb.2, implicit $exec
|
2017-11-14 10:16:54 +08:00
|
|
|
S_BRANCH %bb.1
|
|
|
|
|
|
|
|
bb.1:
|
|
|
|
successors: %bb.3(0x80000000)
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $vgpr0, $vgpr1
|
2017-11-14 10:16:54 +08:00
|
|
|
|
2018-02-01 06:04:26 +08:00
|
|
|
$sgpr2_sgpr3 = S_MOV_B64 0
|
|
|
|
$vgpr2 = V_MOV_B32_e32 0, implicit $exec
|
|
|
|
$sgpr4_sgpr5 = IMPLICIT_DEF
|
2017-11-14 10:16:54 +08:00
|
|
|
S_BRANCH %bb.3
|
|
|
|
|
|
|
|
bb.2:
|
|
|
|
successors:
|
[AMDGPU] Correct the setting of `FlatScratchInit`.
Summary: - That flag setting should skip spilling stack slot.
Reviewers: arsenm, rampitec
Subscribers: qcolombet, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64143
llvm-svn: 365137
2019-07-04 21:29:45 +08:00
|
|
|
liveins: $sgpr8_sgpr9_sgpr10_sgpr11, $sgpr13
|
2017-11-14 10:16:54 +08:00
|
|
|
|
2018-02-03 00:07:16 +08:00
|
|
|
$sgpr0_sgpr1 = SI_SPILL_S64_RESTORE %stack.0, implicit $exec, implicit $sgpr8_sgpr9_sgpr10_sgpr11, implicit $sgpr13, implicit-def dead $m0 :: (load 8 from %stack.0, align 4, addrspace 5)
|
2018-02-01 06:04:26 +08:00
|
|
|
$exec = S_OR_B64 $exec, killed $sgpr0_sgpr1, implicit-def $scc
|
2017-11-14 10:16:54 +08:00
|
|
|
|
|
|
|
bb.3:
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $vgpr0, $vgpr1, $vgpr2, $sgpr2_sgpr3, $sgpr4_sgpr5
|
2017-11-14 10:16:54 +08:00
|
|
|
|
2018-02-01 06:04:26 +08:00
|
|
|
$vcc = COPY $vgpr1
|
[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-11-14 10:16:54 +08:00
|
|
|
|
|
|
|
...
|
|
|
|
---
|
|
|
|
|
|
|
|
# Move spill to after future save instruction
|
2017-11-14 14:40:00 +08:00
|
|
|
# CHECK-LABEL: {{^}}name: undefined_physreg_sgpr_spill_reorder
|
2018-02-01 06:04:26 +08:00
|
|
|
# CHECK: $sgpr0_sgpr1 = COPY $exec, implicit-def $exec
|
|
|
|
# CHECK: $sgpr2_sgpr3 = S_AND_B64 $sgpr0_sgpr1, killed $vcc, implicit-def dead $scc
|
2018-02-03 00:07:16 +08:00
|
|
|
# CHECK: SI_SPILL_S64_SAVE killed $sgpr0_sgpr1, %stack.0, implicit $exec, implicit $sgpr8_sgpr9_sgpr10_sgpr11, implicit $sgpr13, implicit-def dead $m0 :: (store 8 into %stack.0, align 4, addrspace 5)
|
2018-02-01 06:04:26 +08:00
|
|
|
# CHECK: $exec = COPY killed $sgpr2_sgpr3
|
2017-11-14 10:16:54 +08:00
|
|
|
name: undefined_physreg_sgpr_spill_reorder
|
[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-11-14 10:16:54 +08:00
|
|
|
exposesReturnsTwice: false
|
|
|
|
legalized: false
|
|
|
|
regBankSelected: false
|
|
|
|
selected: false
|
|
|
|
tracksRegLiveness: true
|
|
|
|
registers:
|
|
|
|
liveins:
|
2018-02-01 06:04:26 +08:00
|
|
|
- { reg: '$vgpr0', virtual-reg: '' }
|
|
|
|
- { reg: '$sgpr4_sgpr5', virtual-reg: '' }
|
2017-11-14 10:16:54 +08:00
|
|
|
stack:
|
|
|
|
- { id: 0, name: '', type: spill-slot, offset: 0, size: 8, alignment: 4,
|
2019-06-17 17:13:29 +08:00
|
|
|
stack-id: sgpr-spill, callee-saved-register: '', callee-saved-restored: true,
|
2018-04-26 02:58:06 +08:00
|
|
|
debug-info-variable: '', debug-info-expression: '',
|
|
|
|
debug-info-location: '' }
|
2017-11-14 10:16:54 +08:00
|
|
|
constants:
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
successors: %bb.1, %bb.2
|
[AMDGPU] Correct the setting of `FlatScratchInit`.
Summary: - That flag setting should skip spilling stack slot.
Reviewers: arsenm, rampitec
Subscribers: qcolombet, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64143
llvm-svn: 365137
2019-07-04 21:29:45 +08:00
|
|
|
liveins: $vgpr0, $sgpr4_sgpr5, $sgpr8_sgpr9_sgpr10_sgpr11, $sgpr13
|
2018-02-01 06:04:26 +08:00
|
|
|
|
|
|
|
$vgpr1_vgpr2 = COPY killed $sgpr4_sgpr5, implicit $exec
|
2019-05-01 06:08:23 +08:00
|
|
|
$vgpr1 = GLOBAL_LOAD_UBYTE killed $vgpr1_vgpr2, 0, 0, 0, 0, implicit $exec :: (non-temporal dereferenceable invariant load 1 from `i1 addrspace(4)* undef`)
|
2018-02-01 06:04:26 +08:00
|
|
|
$vcc = V_CMP_NE_U32_e64 0, $vgpr0, implicit $exec
|
|
|
|
$sgpr0_sgpr1 = V_CMP_EQ_U32_e64 1, killed $vgpr1, implicit $exec
|
2019-03-19 03:25:39 +08:00
|
|
|
$vgpr1 = V_CNDMASK_B32_e64 0, 0, 0, -1, killed $sgpr0_sgpr1, implicit $exec
|
2018-02-01 06:04:26 +08:00
|
|
|
$sgpr0_sgpr1 = COPY $exec, implicit-def $exec
|
|
|
|
$sgpr2_sgpr3 = S_AND_B64 $sgpr0_sgpr1, killed $vcc, implicit-def dead $scc
|
2018-02-03 00:07:16 +08:00
|
|
|
SI_SPILL_S64_SAVE killed $sgpr0_sgpr1, %stack.0, implicit $exec, implicit $sgpr8_sgpr9_sgpr10_sgpr11, implicit $sgpr13, implicit-def dead $m0 :: (store 8 into %stack.0, align 4, addrspace 5)
|
2018-02-01 06:04:26 +08:00
|
|
|
$exec = S_MOV_B64_term killed $sgpr2_sgpr3
|
|
|
|
SI_MASK_BRANCH %bb.2, implicit $exec
|
2017-11-14 10:16:54 +08:00
|
|
|
S_BRANCH %bb.1
|
|
|
|
|
|
|
|
bb.1:
|
|
|
|
successors: %bb.3(0x80000000)
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $vgpr0, $vgpr1
|
2017-11-14 10:16:54 +08:00
|
|
|
|
2018-02-01 06:04:26 +08:00
|
|
|
$sgpr2_sgpr3 = S_MOV_B64 0
|
|
|
|
$vgpr2 = V_MOV_B32_e32 0, implicit $exec
|
|
|
|
$sgpr4_sgpr5 = IMPLICIT_DEF
|
2017-11-14 10:16:54 +08:00
|
|
|
S_BRANCH %bb.3
|
|
|
|
|
|
|
|
bb.2:
|
|
|
|
successors:
|
[AMDGPU] Correct the setting of `FlatScratchInit`.
Summary: - That flag setting should skip spilling stack slot.
Reviewers: arsenm, rampitec
Subscribers: qcolombet, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64143
llvm-svn: 365137
2019-07-04 21:29:45 +08:00
|
|
|
liveins: $sgpr8_sgpr9_sgpr10_sgpr11, $sgpr13
|
2017-11-14 10:16:54 +08:00
|
|
|
|
2018-02-03 00:07:16 +08:00
|
|
|
$sgpr0_sgpr1 = SI_SPILL_S64_RESTORE %stack.0, implicit $exec, implicit $sgpr8_sgpr9_sgpr10_sgpr11, implicit $sgpr13, implicit-def dead $m0 :: (load 8 from %stack.0, align 4, addrspace 5)
|
2018-02-01 06:04:26 +08:00
|
|
|
$exec = S_OR_B64 $exec, killed $sgpr0_sgpr1, implicit-def $scc
|
2017-11-14 10:16:54 +08:00
|
|
|
|
|
|
|
bb.3:
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $vgpr0, $vgpr1, $vgpr2, $sgpr2_sgpr3, $sgpr4_sgpr5
|
2017-11-14 10:16:54 +08:00
|
|
|
|
2018-02-01 06:04:26 +08:00
|
|
|
$vcc = COPY $vgpr1
|
[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-11-14 10:16:54 +08:00
|
|
|
|
|
|
|
...
|