forked from OSchip/llvm-project
AMDGPU: Remove VS/SV mappings from select
These would violate the constant bus restriction llvm-svn: 350517
This commit is contained in:
parent
55b6d4b9f9
commit
369acb8470
|
@ -180,22 +180,6 @@ AMDGPURegisterBankInfo::getInstrAlternativeMappings(
|
|||
4); // Num Operands
|
||||
AltMappings.push_back(&SSMapping);
|
||||
|
||||
const InstructionMapping &SVMapping = getInstructionMapping(2, 1,
|
||||
getOperandsMapping({AMDGPU::getValueMapping(AMDGPU::VGPRRegBankID, Size),
|
||||
AMDGPU::getValueMapping(AMDGPU::SGPRRegBankID, 1),
|
||||
AMDGPU::getValueMapping(AMDGPU::SGPRRegBankID, Size),
|
||||
AMDGPU::getValueMapping(AMDGPU::VGPRRegBankID, Size)}),
|
||||
4); // Num Operands
|
||||
AltMappings.push_back(&SVMapping);
|
||||
|
||||
const InstructionMapping &VSMapping = getInstructionMapping(2, 1,
|
||||
getOperandsMapping({AMDGPU::getValueMapping(AMDGPU::VGPRRegBankID, Size),
|
||||
AMDGPU::getValueMapping(AMDGPU::SGPRRegBankID, 1),
|
||||
AMDGPU::getValueMapping(AMDGPU::VGPRRegBankID, Size),
|
||||
AMDGPU::getValueMapping(AMDGPU::SGPRRegBankID, Size)}),
|
||||
4); // Num Operands
|
||||
AltMappings.push_back(&VSMapping);
|
||||
|
||||
const InstructionMapping &VVMapping = getInstructionMapping(2, 1,
|
||||
getOperandsMapping({AMDGPU::getValueMapping(AMDGPU::VGPRRegBankID, Size),
|
||||
AMDGPU::getValueMapping(AMDGPU::SGPRRegBankID, 1),
|
||||
|
|
|
@ -1,34 +1,21 @@
|
|||
# RUN: llc -march=amdgcn -mcpu=fiji -run-pass=regbankselect -global-isel %s -verify-machineinstrs -o - -regbankselect-fast | FileCheck --check-prefixes=GCN,FAST %s
|
||||
# RUN: llc -march=amdgcn -mcpu=fiji -run-pass=regbankselect -global-isel %s -verify-machineinstrs -o - -regbankselect-greedy | FileCheck --check-prefixes=GCN,GREEDY %s
|
||||
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
|
||||
# RUN: llc -march=amdgcn -mcpu=fiji -run-pass=regbankselect -global-isel %s -verify-machineinstrs -o - -regbankselect-fast | FileCheck %s
|
||||
# RUN: llc -march=amdgcn -mcpu=fiji -run-pass=regbankselect -global-isel %s -verify-machineinstrs -o - -regbankselect-greedy | FileCheck %s
|
||||
|
||||
# REQUIRES: global-isel
|
||||
|
||||
--- |
|
||||
define void @select_sss() { ret void }
|
||||
define void @select_ssv() { ret void }
|
||||
define void @select_svs() { ret void }
|
||||
define void @select_svv() { ret void }
|
||||
define void @select_vss() { ret void }
|
||||
define void @select_vsv() { ret void }
|
||||
define void @select_vvs() { ret void }
|
||||
define void @select_vvv() { ret void }
|
||||
...
|
||||
|
||||
---
|
||||
name: select_sss
|
||||
legalized: true
|
||||
|
||||
# GCN-LABEL: name: select_sss
|
||||
# GCN: [[SGPR0:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
|
||||
# GCN: [[SGPR1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
|
||||
# GCN: [[SGPR2:%[0-9]+]]:sgpr(s32) = COPY $sgpr2
|
||||
# GCN: [[SGPR3:%[0-9]+]]:sgpr(s32) = COPY $sgpr3
|
||||
# GCN: [[SCC:%[0-9]+]]:scc(s1) = G_ICMP intpred(ne), [[SGPR0]](s32), [[SGPR1]]
|
||||
# GCN: {{%[0-9]+}}:sgpr(s32) = G_SELECT [[SCC]](s1), [[SGPR2]], [[SGPR3]]
|
||||
|
||||
body: |
|
||||
bb.0:
|
||||
liveins: $sgpr0, $sgpr1, $sgpr2, $sgpr3
|
||||
; CHECK-LABEL: name: select_sss
|
||||
; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
|
||||
; CHECK: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
|
||||
; CHECK: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr2
|
||||
; CHECK: [[COPY3:%[0-9]+]]:sgpr(s32) = COPY $sgpr3
|
||||
; CHECK: [[ICMP:%[0-9]+]]:scc(s1) = G_ICMP intpred(ne), [[COPY]](s32), [[COPY1]]
|
||||
; CHECK: [[SELECT:%[0-9]+]]:sgpr(s32) = G_SELECT [[ICMP]](s1), [[COPY2]], [[COPY3]]
|
||||
%0:_(s32) = COPY $sgpr0
|
||||
%1:_(s32) = COPY $sgpr1
|
||||
%2:_(s32) = COPY $sgpr2
|
||||
|
@ -40,24 +27,21 @@ body: |
|
|||
---
|
||||
name: select_ssv
|
||||
legalized: true
|
||||
|
||||
# GCN-LABEL: name: select_ssv
|
||||
# GCN: [[SGPR0:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
|
||||
# GCN: [[SGPR1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
|
||||
# GCN: [[SGPR2:%[0-9]+]]:sgpr(s32) = COPY $sgpr2
|
||||
# GCN: [[VGPR0:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
|
||||
# GCN: [[SCC:%[0-9]+]]:scc(s1) = G_ICMP intpred(ne), [[SGPR0]](s32), [[SGPR1]]
|
||||
# GCN: [[SCC_S:%[0-9]+]]:sgpr(s1) = COPY [[SCC]]
|
||||
# FAST: [[SGPR2_V:%[0-9]+]]:vgpr(s32) = COPY [[SGPR2]]
|
||||
# FAST: {{%[0-9]+}}:vgpr(s32) = G_SELECT [[SCC_S]](s1), [[SGPR2_V]], [[VGPR0]]
|
||||
# GREEDY: {{%[0-9]+}}:vgpr(s32) = G_SELECT [[SCC_S]](s1), [[SGPR2]], [[VGPR0]]
|
||||
|
||||
body: |
|
||||
bb.0:
|
||||
liveins: $sgpr0, $sgpr1, $sgpr2, $vgpr0
|
||||
; CHECK-LABEL: name: select_ssv
|
||||
; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
|
||||
; CHECK: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
|
||||
; CHECK: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr2
|
||||
; CHECK: [[COPY3:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
|
||||
; CHECK: [[ICMP:%[0-9]+]]:scc(s1) = G_ICMP intpred(ne), [[COPY]](s32), [[COPY1]]
|
||||
; CHECK: [[COPY4:%[0-9]+]]:sgpr(s1) = COPY [[ICMP]](s1)
|
||||
; CHECK: [[COPY5:%[0-9]+]]:vgpr(s32) = COPY [[COPY2]](s32)
|
||||
; CHECK: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[COPY4]](s1), [[COPY5]], [[COPY3]]
|
||||
%0:_(s32) = COPY $sgpr0
|
||||
%1:_(s32) = COPY $sgpr1
|
||||
%2:_(s32) = COPY $sgpr2
|
||||
%2:_(s32) = COPY $sgpr2
|
||||
%3:_(s32) = COPY $vgpr0
|
||||
%4:_(s1) = G_ICMP intpred(ne), %0, %1
|
||||
%5:_(s32) = G_SELECT %4, %2, %3
|
||||
|
@ -67,21 +51,18 @@ body: |
|
|||
---
|
||||
name: select_svs
|
||||
legalized: true
|
||||
|
||||
# GCN-LABEL: name: select_svs
|
||||
# GCN: [[SGPR0:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
|
||||
# GCN: [[SGPR1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
|
||||
# GCN: [[SGPR2:%[0-9]+]]:sgpr(s32) = COPY $sgpr2
|
||||
# GCN: [[VGPR0:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
|
||||
# GCN: [[SCC:%[0-9]+]]:scc(s1) = G_ICMP intpred(ne), [[SGPR0]](s32), [[SGPR1]]
|
||||
# GCN: [[SCC_S:%[0-9]+]]:sgpr(s1) = COPY [[SCC]]
|
||||
# FAST: [[SGPR2_V:%[0-9]+]]:vgpr(s32) = COPY [[SGPR2]]
|
||||
# FAST: {{%[0-9]+}}:vgpr(s32) = G_SELECT [[SCC_S]](s1), [[VGPR0]], [[SGPR2_V]]
|
||||
# GREEDY: {{%[0-9]+}}:vgpr(s32) = G_SELECT [[SCC_S]](s1), [[VGPR0]], [[SGPR2]]
|
||||
|
||||
body: |
|
||||
bb.0:
|
||||
liveins: $sgpr0, $sgpr1, $sgpr2, $vgpr0
|
||||
; CHECK-LABEL: name: select_svs
|
||||
; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
|
||||
; CHECK: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
|
||||
; CHECK: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr2
|
||||
; CHECK: [[COPY3:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
|
||||
; CHECK: [[ICMP:%[0-9]+]]:scc(s1) = G_ICMP intpred(ne), [[COPY]](s32), [[COPY1]]
|
||||
; CHECK: [[COPY4:%[0-9]+]]:sgpr(s1) = COPY [[ICMP]](s1)
|
||||
; CHECK: [[COPY5:%[0-9]+]]:vgpr(s32) = COPY [[COPY2]](s32)
|
||||
; CHECK: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[COPY4]](s1), [[COPY3]], [[COPY5]]
|
||||
%0:_(s32) = COPY $sgpr0
|
||||
%1:_(s32) = COPY $sgpr1
|
||||
%2:_(s32) = COPY $sgpr2
|
||||
|
@ -93,19 +74,17 @@ body: |
|
|||
---
|
||||
name: select_svv
|
||||
legalized: true
|
||||
|
||||
# GCN-LABEL: name: select_svv
|
||||
# GCN: [[SGPR0:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
|
||||
# GCN: [[SGPR1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
|
||||
# GCN: [[VGPR0:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
|
||||
# GCN: [[VGPR1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
|
||||
# GCN: [[SCC:%[0-9]+]]:scc(s1) = G_ICMP intpred(ne), [[SGPR0]](s32), [[SGPR1]]
|
||||
# GCN: [[SCC_S:%[0-9]+]]:sgpr(s1) = COPY [[SCC]]
|
||||
# GCN: {{%[0-9]+}}:vgpr(s32) = G_SELECT [[SCC_S]](s1), [[VGPR0]], [[VGPR1]]
|
||||
|
||||
body: |
|
||||
bb.0:
|
||||
liveins: $sgpr0, $sgpr1, $vgpr0, $vgpr1
|
||||
; CHECK-LABEL: name: select_svv
|
||||
; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
|
||||
; CHECK: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
|
||||
; CHECK: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
|
||||
; CHECK: [[COPY3:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
|
||||
; CHECK: [[ICMP:%[0-9]+]]:scc(s1) = G_ICMP intpred(ne), [[COPY]](s32), [[COPY1]]
|
||||
; CHECK: [[COPY4:%[0-9]+]]:sgpr(s1) = COPY [[ICMP]](s1)
|
||||
; CHECK: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[COPY4]](s1), [[COPY2]], [[COPY3]]
|
||||
%0:_(s32) = COPY $sgpr0
|
||||
%1:_(s32) = COPY $sgpr1
|
||||
%2:_(s32) = COPY $vgpr0
|
||||
|
@ -117,21 +96,18 @@ body: |
|
|||
---
|
||||
name: select_vss
|
||||
legalized: true
|
||||
|
||||
# GCN-LABEL: name: select_vss
|
||||
# GCN: [[SGPR0:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
|
||||
# GCN: [[SGPR1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
|
||||
# GCN: [[VGPR0:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
|
||||
# GCN: [[VGPR1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
|
||||
# GCN: [[VCC:%[0-9]+]]:sgpr(s1) = G_ICMP intpred(ne), [[VGPR0]](s32), [[VGPR1]]
|
||||
# FAST: [[SGPR0_V:%[0-9]+]]:vgpr(s32) = COPY [[SGPR0]]
|
||||
# GCN: [[SGPR1_V:%[0-9]+]]:vgpr(s32) = COPY [[SGPR1]]
|
||||
# FAST: {{%[0-9]+}}:vgpr(s32) = G_SELECT [[VCC]](s1), [[SGPR0_V]], [[SGPR1_V]]
|
||||
# GREDY: {{%[0-9]+}}:vgpr(s32) = G_SELECT [[VCC]](s1), [[SGPR0]], [[SGPR1_V]]
|
||||
|
||||
body: |
|
||||
bb.0:
|
||||
liveins: $sgpr0, $sgpr1, $vgpr0, $vgpr1
|
||||
; CHECK-LABEL: name: select_vss
|
||||
; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
|
||||
; CHECK: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
|
||||
; CHECK: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
|
||||
; CHECK: [[COPY3:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
|
||||
; CHECK: [[ICMP:%[0-9]+]]:sgpr(s1) = G_ICMP intpred(ne), [[COPY2]](s32), [[COPY3]]
|
||||
; CHECK: [[COPY4:%[0-9]+]]:vgpr(s32) = COPY [[COPY]](s32)
|
||||
; CHECK: [[COPY5:%[0-9]+]]:vgpr(s32) = COPY [[COPY1]](s32)
|
||||
; CHECK: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[ICMP]](s1), [[COPY4]], [[COPY5]]
|
||||
%0:_(s32) = COPY $sgpr0
|
||||
%1:_(s32) = COPY $sgpr1
|
||||
%2:_(s32) = COPY $vgpr0
|
||||
|
@ -143,20 +119,17 @@ body: |
|
|||
---
|
||||
name: select_vsv
|
||||
legalized: true
|
||||
|
||||
# GCN-LABEL: name: select_vsv
|
||||
# GCN: [[SGPR0:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
|
||||
# GCN: [[VGPR0:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
|
||||
# GCN: [[VGPR1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
|
||||
# GCN: [[VGPR2:%[0-9]+]]:vgpr(s32) = COPY $vgpr2
|
||||
# GCN: [[VCC:%[0-9]+]]:sgpr(s1) = G_ICMP intpred(ne), [[VGPR0]](s32), [[VGPR1]]
|
||||
# FAST: [[SGPR0_V:%[0-9]+]]:vgpr(s32) = COPY [[SGPR0]]
|
||||
# FAST: {{%[0-9]+}}:vgpr(s32) = G_SELECT [[VCC]](s1), [[SGPR0_V]], [[VGPR2]]
|
||||
# GREEDY: {{%[0-9]+}}:vgpr(s32) = G_SELECT [[VCC]](s1), [[SGPR0]], [[VGPR2]]
|
||||
|
||||
body: |
|
||||
bb.0:
|
||||
liveins: $sgpr0, $vgpr0, $vgpr1, $vgpr2
|
||||
; CHECK-LABEL: name: select_vsv
|
||||
; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
|
||||
; CHECK: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
|
||||
; CHECK: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
|
||||
; CHECK: [[COPY3:%[0-9]+]]:vgpr(s32) = COPY $vgpr2
|
||||
; CHECK: [[ICMP:%[0-9]+]]:sgpr(s1) = G_ICMP intpred(ne), [[COPY1]](s32), [[COPY2]]
|
||||
; CHECK: [[COPY4:%[0-9]+]]:vgpr(s32) = COPY [[COPY]](s32)
|
||||
; CHECK: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[ICMP]](s1), [[COPY4]], [[COPY3]]
|
||||
%0:_(s32) = COPY $sgpr0
|
||||
%1:_(s32) = COPY $vgpr0
|
||||
%2:_(s32) = COPY $vgpr1
|
||||
|
@ -168,20 +141,17 @@ body: |
|
|||
---
|
||||
name: select_vvs
|
||||
legalized: true
|
||||
|
||||
# GCN-LABEL: name: select_vvs
|
||||
# GCN: [[SGPR0:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
|
||||
# GCN: [[VGPR0:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
|
||||
# GCN: [[VGPR1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
|
||||
# GCN: [[VGPR2:%[0-9]+]]:vgpr(s32) = COPY $vgpr2
|
||||
# GCN: [[VCC:%[0-9]+]]:sgpr(s1) = G_ICMP intpred(ne), [[VGPR0]](s32), [[VGPR1]]
|
||||
# FAST: [[SGPR0_V:%[0-9]+]]:vgpr(s32) = COPY [[SGPR0]]
|
||||
# FAST: {{%[0-9]+}}:vgpr(s32) = G_SELECT [[VCC]](s1), [[VGPR2]], [[SGPR0_V]]
|
||||
# GREEDY: {{%[0-9]+}}:vgpr(s32) = G_SELECT [[VCC]](s1), [[VGPR2]], [[SGPR0]]
|
||||
|
||||
body: |
|
||||
bb.0:
|
||||
liveins: $sgpr0, $vgpr0, $vgpr1, $vgpr2
|
||||
; CHECK-LABEL: name: select_vvs
|
||||
; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
|
||||
; CHECK: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
|
||||
; CHECK: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
|
||||
; CHECK: [[COPY3:%[0-9]+]]:vgpr(s32) = COPY $vgpr2
|
||||
; CHECK: [[ICMP:%[0-9]+]]:sgpr(s1) = G_ICMP intpred(ne), [[COPY1]](s32), [[COPY2]]
|
||||
; CHECK: [[COPY4:%[0-9]+]]:vgpr(s32) = COPY [[COPY]](s32)
|
||||
; CHECK: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[ICMP]](s1), [[COPY3]], [[COPY4]]
|
||||
%0:_(s32) = COPY $sgpr0
|
||||
%1:_(s32) = COPY $vgpr0
|
||||
%2:_(s32) = COPY $vgpr1
|
||||
|
@ -193,18 +163,16 @@ body: |
|
|||
---
|
||||
name: select_vvv
|
||||
legalized: true
|
||||
|
||||
# GCN-LABEL: name: select_vvv
|
||||
# GCN: [[VGPR0:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
|
||||
# GCN: [[VGPR1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
|
||||
# GCN: [[VGPR2:%[0-9]+]]:vgpr(s32) = COPY $vgpr2
|
||||
# GCN: [[VGPR3:%[0-9]+]]:vgpr(s32) = COPY $vgpr3
|
||||
# GCN: [[VCC:%[0-9]+]]:sgpr(s1) = G_ICMP intpred(ne), [[VGPR0]](s32), [[VGPR1]]
|
||||
# GCN: {{%[0-9]+}}:vgpr(s32) = G_SELECT [[VCC]](s1), [[VGPR2]], [[VGPR3]]
|
||||
|
||||
body: |
|
||||
bb.0:
|
||||
liveins: $vgpr0, $vgpr1, $vgpr2, $vgpr3
|
||||
; CHECK-LABEL: name: select_vvv
|
||||
; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
|
||||
; CHECK: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
|
||||
; CHECK: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY $vgpr2
|
||||
; CHECK: [[COPY3:%[0-9]+]]:vgpr(s32) = COPY $vgpr3
|
||||
; CHECK: [[ICMP:%[0-9]+]]:sgpr(s1) = G_ICMP intpred(ne), [[COPY]](s32), [[COPY1]]
|
||||
; CHECK: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[ICMP]](s1), [[COPY2]], [[COPY3]]
|
||||
%0:_(s32) = COPY $vgpr0
|
||||
%1:_(s32) = COPY $vgpr1
|
||||
%2:_(s32) = COPY $vgpr2
|
||||
|
|
Loading…
Reference in New Issue