forked from OSchip/llvm-project
AMDGPU/GlobalISel: Legalize select for pointer types
llvm-svn: 352974
This commit is contained in:
parent
cbaada6bc1
commit
2491f82679
|
@ -359,7 +359,9 @@ AMDGPULegalizerInfo::AMDGPULegalizerInfo(const GCNSubtarget &ST,
|
|||
|
||||
// TODO: Pointer types, any 32-bit or 64-bit vector
|
||||
getActionDefinitionsBuilder(G_SELECT)
|
||||
.legalFor({{S32, S1}, {S64, S1}, {V2S32, S1}, {V2S16, S1}})
|
||||
.legalForCartesianProduct({S32, S64, V2S32, V2S16, GlobalPtr, LocalPtr,
|
||||
FlatPtr, PrivatePtr, LLT::vector(2, LocalPtr),
|
||||
LLT::vector(2, PrivatePtr)}, {S1})
|
||||
.clampScalar(0, S32, S64)
|
||||
.fewerElementsIf(
|
||||
[=](const LegalityQuery &Query) {
|
||||
|
@ -380,7 +382,10 @@ AMDGPULegalizerInfo::AMDGPULegalizerInfo(const GCNSubtarget &ST,
|
|||
Query.Types[0].getElementType().getSizeInBits() < 32;},
|
||||
scalarize(0))
|
||||
.scalarize(1)
|
||||
.clampMaxNumElements(0, S32, 2);
|
||||
.clampMaxNumElements(0, S32, 2)
|
||||
.clampMaxNumElements(0, LocalPtr, 2)
|
||||
.clampMaxNumElements(0, PrivatePtr, 2)
|
||||
.legalIf(all(isPointer(0), typeIs(1, S1)));
|
||||
|
||||
// TODO: Only the low 4/5/6 bits of the shift amount are observed, so we can
|
||||
// be more flexible with the shift amount type.
|
||||
|
@ -435,7 +440,8 @@ AMDGPULegalizerInfo::AMDGPULegalizerInfo(const GCNSubtarget &ST,
|
|||
.minScalarSameAs(1, 0)
|
||||
// FIXME: Sort of a hack to make progress on other legalizations.
|
||||
.legalIf([=](const LegalityQuery &Query) {
|
||||
return Query.Types[0].getScalarSizeInBits() < 32;
|
||||
return Query.Types[0].getScalarSizeInBits() <= 32 ||
|
||||
Query.Types[0].getScalarSizeInBits() == 64;
|
||||
});
|
||||
|
||||
// TODO: Support any combination of v2s32
|
||||
|
@ -446,7 +452,9 @@ AMDGPULegalizerInfo::AMDGPULegalizerInfo(const GCNSubtarget &ST,
|
|||
{V4S64, V2S64},
|
||||
{V4S16, V2S16},
|
||||
{V8S16, V2S16},
|
||||
{V8S16, V4S16}});
|
||||
{V8S16, V4S16},
|
||||
{LLT::vector(4, LocalPtr), LLT::vector(2, LocalPtr)},
|
||||
{LLT::vector(4, PrivatePtr), LLT::vector(2, PrivatePtr)}});
|
||||
|
||||
// Merge/Unmerge
|
||||
for (unsigned Op : {G_MERGE_VALUES, G_UNMERGE_VALUES}) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
|
||||
# RUN: llc -O0 -march=amdgcn -mcpu=fiji -run-pass=legalizer %s -o - | FileCheck %s
|
||||
# RUN: llc -O0 -march=amdgcn -mcpu=tahiti -run-pass=legalizer %s -o - | FileCheck %s
|
||||
|
||||
---
|
||||
name: test_select_s32
|
||||
|
@ -49,6 +49,113 @@ body: |
|
|||
|
||||
...
|
||||
|
||||
---
|
||||
name: test_select_s16
|
||||
body: |
|
||||
bb.0:
|
||||
liveins: $vgpr0
|
||||
; CHECK-LABEL: name: test_select_s16
|
||||
; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
|
||||
; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
|
||||
; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[C]](s32), [[COPY]]
|
||||
; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
|
||||
; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 2
|
||||
; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
|
||||
; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[C2]](s32)
|
||||
; CHECK: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s1), [[COPY1]], [[COPY2]]
|
||||
; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[SELECT]](s32)
|
||||
; CHECK: $vgpr0 = COPY [[COPY3]](s32)
|
||||
%0:_(s32) = G_CONSTANT i32 0
|
||||
%1:_(s32) = COPY $vgpr0
|
||||
|
||||
%2:_(s1) = G_ICMP intpred(ne), %0, %1
|
||||
%3:_(s16) = G_CONSTANT i16 1
|
||||
%4:_(s16) = G_CONSTANT i16 2
|
||||
%5:_(s16) = G_SELECT %2, %3, %4
|
||||
%6:_(s32) = G_ANYEXT %5
|
||||
$vgpr0 = COPY %6
|
||||
|
||||
...
|
||||
|
||||
---
|
||||
name: test_select_s8
|
||||
body: |
|
||||
bb.0:
|
||||
liveins: $vgpr0
|
||||
; CHECK-LABEL: name: test_select_s8
|
||||
; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
|
||||
; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
|
||||
; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[C]](s32), [[COPY]]
|
||||
; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
|
||||
; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 2
|
||||
; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
|
||||
; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[C2]](s32)
|
||||
; CHECK: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s1), [[COPY1]], [[COPY2]]
|
||||
; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[SELECT]](s32)
|
||||
; CHECK: $vgpr0 = COPY [[COPY3]](s32)
|
||||
%0:_(s32) = G_CONSTANT i32 0
|
||||
%1:_(s32) = COPY $vgpr0
|
||||
|
||||
%2:_(s1) = G_ICMP intpred(ne), %0, %1
|
||||
%3:_(s8) = G_CONSTANT i16 1
|
||||
%4:_(s8) = G_CONSTANT i16 2
|
||||
%5:_(s8) = G_SELECT %2, %3, %4
|
||||
%6:_(s32) = G_ANYEXT %5
|
||||
$vgpr0 = COPY %6
|
||||
|
||||
...
|
||||
|
||||
---
|
||||
name: test_select_s7
|
||||
body: |
|
||||
bb.0:
|
||||
liveins: $vgpr0
|
||||
; CHECK-LABEL: name: test_select_s7
|
||||
; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
|
||||
; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
|
||||
; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[C]](s32), [[COPY]]
|
||||
; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
|
||||
; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 2
|
||||
; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
|
||||
; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[C2]](s32)
|
||||
; CHECK: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s1), [[COPY1]], [[COPY2]]
|
||||
; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[SELECT]](s32)
|
||||
; CHECK: $vgpr0 = COPY [[COPY3]](s32)
|
||||
%0:_(s32) = G_CONSTANT i32 0
|
||||
%1:_(s32) = COPY $vgpr0
|
||||
|
||||
%2:_(s1) = G_ICMP intpred(ne), %0, %1
|
||||
%3:_(s7) = G_CONSTANT i16 1
|
||||
%4:_(s7) = G_CONSTANT i16 2
|
||||
%5:_(s7) = G_SELECT %2, %3, %4
|
||||
%6:_(s32) = G_ANYEXT %5
|
||||
$vgpr0 = COPY %6
|
||||
|
||||
...
|
||||
---
|
||||
name: test_select_v2s16
|
||||
body: |
|
||||
bb.0:
|
||||
liveins: $vgpr0, $vgpr1, $vgpr2
|
||||
; CHECK-LABEL: name: test_select_v2s16
|
||||
; CHECK: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr0
|
||||
; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr1
|
||||
; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY $vgpr2
|
||||
; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
|
||||
; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[COPY2]](s32), [[C]]
|
||||
; CHECK: [[SELECT:%[0-9]+]]:_(<2 x s16>) = G_SELECT [[ICMP]](s1), [[COPY]], [[COPY1]]
|
||||
; CHECK: $vgpr0 = COPY [[SELECT]](<2 x s16>)
|
||||
%0:_(<2 x s16>) = COPY $vgpr0
|
||||
%1:_(<2 x s16>) = COPY $vgpr1
|
||||
%2:_(s32) = COPY $vgpr2
|
||||
%3:_(s32) = G_CONSTANT i32 0
|
||||
|
||||
%4:_(s1) = G_ICMP intpred(ne), %2, %3
|
||||
%5:_(<2 x s16>) = G_SELECT %4, %0, %1
|
||||
$vgpr0 = COPY %5
|
||||
|
||||
...
|
||||
|
||||
---
|
||||
name: test_select_v2s32
|
||||
body: |
|
||||
|
@ -159,111 +266,411 @@ body: |
|
|||
...
|
||||
|
||||
---
|
||||
name: test_select_s16
|
||||
name: test_select_p0
|
||||
body: |
|
||||
bb.0:
|
||||
liveins: $vgpr0
|
||||
; CHECK-LABEL: name: test_select_s16
|
||||
liveins: $vgpr0, $vgpr1_vgpr2, $vgpr3_vgpr4
|
||||
; CHECK-LABEL: name: test_select_p0
|
||||
; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
|
||||
; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
|
||||
; CHECK: [[COPY1:%[0-9]+]]:_(p0) = COPY $vgpr1_vgpr2
|
||||
; CHECK: [[COPY2:%[0-9]+]]:_(p0) = COPY $vgpr3_vgpr4
|
||||
; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[C]](s32), [[COPY]]
|
||||
; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
|
||||
; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 2
|
||||
; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
|
||||
; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[C2]](s32)
|
||||
; CHECK: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s1), [[COPY1]], [[COPY2]]
|
||||
; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[SELECT]](s32)
|
||||
; CHECK: $vgpr0 = COPY [[COPY3]](s32)
|
||||
; CHECK: [[SELECT:%[0-9]+]]:_(p0) = G_SELECT [[ICMP]](s1), [[COPY1]], [[COPY2]]
|
||||
; CHECK: $vgpr0_vgpr1 = COPY [[SELECT]](p0)
|
||||
%0:_(s32) = G_CONSTANT i32 0
|
||||
%1:_(s32) = COPY $vgpr0
|
||||
%2:_(p0) = COPY $vgpr1_vgpr2
|
||||
%3:_(p0) = COPY $vgpr3_vgpr4
|
||||
|
||||
%2:_(s1) = G_ICMP intpred(ne), %0, %1
|
||||
%3:_(s16) = G_CONSTANT i16 1
|
||||
%4:_(s16) = G_CONSTANT i16 2
|
||||
%5:_(s16) = G_SELECT %2, %3, %4
|
||||
%6:_(s32) = G_ANYEXT %5
|
||||
$vgpr0 = COPY %6
|
||||
%4:_(s1) = G_ICMP intpred(ne), %0, %1
|
||||
%5:_(p0) = G_SELECT %4, %2, %3
|
||||
$vgpr0_vgpr1 = COPY %5
|
||||
|
||||
...
|
||||
|
||||
---
|
||||
name: test_select_s8
|
||||
name: test_select_p1
|
||||
body: |
|
||||
bb.0:
|
||||
liveins: $vgpr0
|
||||
; CHECK-LABEL: name: test_select_s8
|
||||
liveins: $vgpr0, $vgpr1_vgpr2, $vgpr3_vgpr4
|
||||
; CHECK-LABEL: name: test_select_p1
|
||||
; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
|
||||
; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
|
||||
; CHECK: [[COPY1:%[0-9]+]]:_(p1) = COPY $vgpr1_vgpr2
|
||||
; CHECK: [[COPY2:%[0-9]+]]:_(p1) = COPY $vgpr3_vgpr4
|
||||
; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[C]](s32), [[COPY]]
|
||||
; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
|
||||
; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 2
|
||||
; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
|
||||
; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[C2]](s32)
|
||||
; CHECK: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s1), [[COPY1]], [[COPY2]]
|
||||
; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[SELECT]](s32)
|
||||
; CHECK: $vgpr0 = COPY [[COPY3]](s32)
|
||||
; CHECK: [[SELECT:%[0-9]+]]:_(p1) = G_SELECT [[ICMP]](s1), [[COPY1]], [[COPY2]]
|
||||
; CHECK: $vgpr0_vgpr1 = COPY [[SELECT]](p1)
|
||||
%0:_(s32) = G_CONSTANT i32 0
|
||||
%1:_(s32) = COPY $vgpr0
|
||||
%2:_(p1) = COPY $vgpr1_vgpr2
|
||||
%3:_(p1) = COPY $vgpr3_vgpr4
|
||||
|
||||
%2:_(s1) = G_ICMP intpred(ne), %0, %1
|
||||
%3:_(s8) = G_CONSTANT i16 1
|
||||
%4:_(s8) = G_CONSTANT i16 2
|
||||
%5:_(s8) = G_SELECT %2, %3, %4
|
||||
%6:_(s32) = G_ANYEXT %5
|
||||
$vgpr0 = COPY %6
|
||||
%4:_(s1) = G_ICMP intpred(ne), %0, %1
|
||||
%5:_(p1) = G_SELECT %4, %2, %3
|
||||
$vgpr0_vgpr1 = COPY %5
|
||||
|
||||
...
|
||||
|
||||
---
|
||||
name: test_select_s7
|
||||
body: |
|
||||
bb.0:
|
||||
liveins: $vgpr0
|
||||
; CHECK-LABEL: name: test_select_s7
|
||||
; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
|
||||
; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
|
||||
; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[C]](s32), [[COPY]]
|
||||
; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
|
||||
; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 2
|
||||
; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
|
||||
; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[C2]](s32)
|
||||
; CHECK: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s1), [[COPY1]], [[COPY2]]
|
||||
; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[SELECT]](s32)
|
||||
; CHECK: $vgpr0 = COPY [[COPY3]](s32)
|
||||
%0:_(s32) = G_CONSTANT i32 0
|
||||
%1:_(s32) = COPY $vgpr0
|
||||
|
||||
%2:_(s1) = G_ICMP intpred(ne), %0, %1
|
||||
%3:_(s7) = G_CONSTANT i16 1
|
||||
%4:_(s7) = G_CONSTANT i16 2
|
||||
%5:_(s7) = G_SELECT %2, %3, %4
|
||||
%6:_(s32) = G_ANYEXT %5
|
||||
$vgpr0 = COPY %6
|
||||
|
||||
...
|
||||
---
|
||||
name: test_select_v2s16
|
||||
name: test_select_p2
|
||||
body: |
|
||||
bb.0:
|
||||
liveins: $vgpr0, $vgpr1, $vgpr2
|
||||
; CHECK-LABEL: name: test_select_v2s16
|
||||
; CHECK: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr0
|
||||
; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr1
|
||||
; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY $vgpr2
|
||||
; CHECK-LABEL: name: test_select_p2
|
||||
; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
|
||||
; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[COPY2]](s32), [[C]]
|
||||
; CHECK: [[SELECT:%[0-9]+]]:_(<2 x s16>) = G_SELECT [[ICMP]](s1), [[COPY]], [[COPY1]]
|
||||
; CHECK: $vgpr0 = COPY [[SELECT]](<2 x s16>)
|
||||
%0:_(<2 x s16>) = COPY $vgpr0
|
||||
%1:_(<2 x s16>) = COPY $vgpr1
|
||||
%2:_(s32) = COPY $vgpr2
|
||||
%3:_(s32) = G_CONSTANT i32 0
|
||||
; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
|
||||
; CHECK: [[COPY1:%[0-9]+]]:_(p2) = COPY $vgpr1
|
||||
; CHECK: [[COPY2:%[0-9]+]]:_(p2) = COPY $vgpr2
|
||||
; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[C]](s32), [[COPY]]
|
||||
; CHECK: [[SELECT:%[0-9]+]]:_(p2) = G_SELECT [[ICMP]](s1), [[COPY1]], [[COPY2]]
|
||||
; CHECK: $vgpr0 = COPY [[SELECT]](p2)
|
||||
%0:_(s32) = G_CONSTANT i32 0
|
||||
%1:_(s32) = COPY $vgpr0
|
||||
%2:_(p2) = COPY $vgpr1
|
||||
%3:_(p2) = COPY $vgpr2
|
||||
|
||||
%4:_(s1) = G_ICMP intpred(ne), %2, %3
|
||||
%5:_(<2 x s16>) = G_SELECT %4, %0, %1
|
||||
%4:_(s1) = G_ICMP intpred(ne), %0, %1
|
||||
%5:_(p2) = G_SELECT %4, %2, %3
|
||||
$vgpr0 = COPY %5
|
||||
|
||||
...
|
||||
|
||||
---
|
||||
name: test_select_p3
|
||||
body: |
|
||||
bb.0:
|
||||
liveins: $vgpr0, $vgpr1, $vgpr2
|
||||
; CHECK-LABEL: name: test_select_p3
|
||||
; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
|
||||
; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
|
||||
; CHECK: [[COPY1:%[0-9]+]]:_(p3) = COPY $vgpr1
|
||||
; CHECK: [[COPY2:%[0-9]+]]:_(p3) = COPY $vgpr2
|
||||
; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[C]](s32), [[COPY]]
|
||||
; CHECK: [[SELECT:%[0-9]+]]:_(p3) = G_SELECT [[ICMP]](s1), [[COPY1]], [[COPY2]]
|
||||
; CHECK: $vgpr0 = COPY [[SELECT]](p3)
|
||||
%0:_(s32) = G_CONSTANT i32 0
|
||||
%1:_(s32) = COPY $vgpr0
|
||||
%2:_(p3) = COPY $vgpr1
|
||||
%3:_(p3) = COPY $vgpr2
|
||||
|
||||
%4:_(s1) = G_ICMP intpred(ne), %0, %1
|
||||
%5:_(p3) = G_SELECT %4, %2, %3
|
||||
$vgpr0 = COPY %5
|
||||
|
||||
...
|
||||
|
||||
---
|
||||
name: test_select_p4
|
||||
body: |
|
||||
bb.0:
|
||||
liveins: $vgpr0, $vgpr1_vgpr2, $vgpr3_vgpr4
|
||||
; CHECK-LABEL: name: test_select_p4
|
||||
; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
|
||||
; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
|
||||
; CHECK: [[COPY1:%[0-9]+]]:_(p4) = COPY $vgpr1_vgpr2
|
||||
; CHECK: [[COPY2:%[0-9]+]]:_(p4) = COPY $vgpr3_vgpr4
|
||||
; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[C]](s32), [[COPY]]
|
||||
; CHECK: [[SELECT:%[0-9]+]]:_(p4) = G_SELECT [[ICMP]](s1), [[COPY1]], [[COPY2]]
|
||||
; CHECK: $vgpr0_vgpr1 = COPY [[SELECT]](p4)
|
||||
%0:_(s32) = G_CONSTANT i32 0
|
||||
%1:_(s32) = COPY $vgpr0
|
||||
%2:_(p4) = COPY $vgpr1_vgpr2
|
||||
%3:_(p4) = COPY $vgpr3_vgpr4
|
||||
|
||||
%4:_(s1) = G_ICMP intpred(ne), %0, %1
|
||||
%5:_(p4) = G_SELECT %4, %2, %3
|
||||
$vgpr0_vgpr1 = COPY %5
|
||||
|
||||
...
|
||||
|
||||
---
|
||||
name: test_select_p5
|
||||
body: |
|
||||
bb.0:
|
||||
liveins: $vgpr0, $vgpr1, $vgpr2
|
||||
; CHECK-LABEL: name: test_select_p5
|
||||
; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
|
||||
; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
|
||||
; CHECK: [[COPY1:%[0-9]+]]:_(p5) = COPY $vgpr1
|
||||
; CHECK: [[COPY2:%[0-9]+]]:_(p5) = COPY $vgpr2
|
||||
; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[C]](s32), [[COPY]]
|
||||
; CHECK: [[SELECT:%[0-9]+]]:_(p5) = G_SELECT [[ICMP]](s1), [[COPY1]], [[COPY2]]
|
||||
; CHECK: $vgpr0 = COPY [[SELECT]](p5)
|
||||
%0:_(s32) = G_CONSTANT i32 0
|
||||
%1:_(s32) = COPY $vgpr0
|
||||
%2:_(p5) = COPY $vgpr1
|
||||
%3:_(p5) = COPY $vgpr2
|
||||
|
||||
%4:_(s1) = G_ICMP intpred(ne), %0, %1
|
||||
%5:_(p5) = G_SELECT %4, %2, %3
|
||||
$vgpr0 = COPY %5
|
||||
|
||||
...
|
||||
|
||||
---
|
||||
name: test_select_p999
|
||||
body: |
|
||||
bb.0:
|
||||
liveins: $vgpr0, $vgpr1_vgpr2, $vgpr3_vgpr4
|
||||
; CHECK-LABEL: name: test_select_p999
|
||||
; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
|
||||
; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
|
||||
; CHECK: [[COPY1:%[0-9]+]]:_(p999) = COPY $vgpr1_vgpr2
|
||||
; CHECK: [[COPY2:%[0-9]+]]:_(p999) = COPY $vgpr3_vgpr4
|
||||
; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[C]](s32), [[COPY]]
|
||||
; CHECK: [[SELECT:%[0-9]+]]:_(p999) = G_SELECT [[ICMP]](s1), [[COPY1]], [[COPY2]]
|
||||
; CHECK: $vgpr0_vgpr1 = COPY [[SELECT]](p999)
|
||||
%0:_(s32) = G_CONSTANT i32 0
|
||||
%1:_(s32) = COPY $vgpr0
|
||||
%2:_(p999) = COPY $vgpr1_vgpr2
|
||||
%3:_(p999) = COPY $vgpr3_vgpr4
|
||||
|
||||
%4:_(s1) = G_ICMP intpred(ne), %0, %1
|
||||
%5:_(p999) = G_SELECT %4, %2, %3
|
||||
$vgpr0_vgpr1 = COPY %5
|
||||
|
||||
...
|
||||
|
||||
---
|
||||
name: test_select_v2p3
|
||||
body: |
|
||||
bb.0:
|
||||
liveins: $vgpr0, $vgpr1_vgpr2, $vgpr3_vgpr4
|
||||
|
||||
; CHECK-LABEL: name: test_select_v2p3
|
||||
; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
|
||||
; CHECK: [[COPY1:%[0-9]+]]:_(<2 x p3>) = COPY $vgpr1_vgpr2
|
||||
; CHECK: [[COPY2:%[0-9]+]]:_(<2 x p3>) = COPY $vgpr3_vgpr4
|
||||
; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
|
||||
; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[COPY]](s32), [[C]]
|
||||
; CHECK: [[SELECT:%[0-9]+]]:_(<2 x p3>) = G_SELECT [[ICMP]](s1), [[COPY1]], [[COPY2]]
|
||||
; CHECK: $vgpr0_vgpr1 = COPY [[SELECT]](<2 x p3>)
|
||||
%0:_(s32) = COPY $vgpr0
|
||||
%1:_(<2 x p3>) = COPY $vgpr1_vgpr2
|
||||
%2:_(<2 x p3>) = COPY $vgpr3_vgpr4
|
||||
%4:_(s32) = G_CONSTANT i32 0
|
||||
%5:_(s1) = G_ICMP intpred(ne), %0, %4
|
||||
%6:_(<2 x p3>) = G_SELECT %5, %1, %2
|
||||
$vgpr0_vgpr1 = COPY %6
|
||||
|
||||
...
|
||||
|
||||
---
|
||||
name: test_select_v3p3
|
||||
body: |
|
||||
bb.0:
|
||||
liveins: $vgpr0, $vgpr1_vgpr2_vgpr3, $vgpr4_vgpr5_vgpr6
|
||||
|
||||
; CHECK-LABEL: name: test_select_v3p3
|
||||
; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
|
||||
; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
|
||||
; CHECK: [[COPY1:%[0-9]+]]:_(<3 x p3>) = COPY $vgpr1_vgpr2_vgpr3
|
||||
; CHECK: [[COPY2:%[0-9]+]]:_(<3 x p3>) = COPY $vgpr4_vgpr5_vgpr6
|
||||
; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[C]](s32), [[COPY]]
|
||||
; CHECK: [[UV:%[0-9]+]]:_(p3), [[UV1:%[0-9]+]]:_(p3), [[UV2:%[0-9]+]]:_(p3) = G_UNMERGE_VALUES [[COPY1]](<3 x p3>)
|
||||
; CHECK: [[UV3:%[0-9]+]]:_(p3), [[UV4:%[0-9]+]]:_(p3), [[UV5:%[0-9]+]]:_(p3) = G_UNMERGE_VALUES [[COPY2]](<3 x p3>)
|
||||
; CHECK: [[SELECT:%[0-9]+]]:_(p3) = G_SELECT [[ICMP]](s1), [[UV]], [[UV3]]
|
||||
; CHECK: [[SELECT1:%[0-9]+]]:_(p3) = G_SELECT [[ICMP]](s1), [[UV1]], [[UV4]]
|
||||
; CHECK: [[SELECT2:%[0-9]+]]:_(p3) = G_SELECT [[ICMP]](s1), [[UV2]], [[UV5]]
|
||||
; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<3 x p3>) = G_BUILD_VECTOR [[SELECT]](p3), [[SELECT1]](p3), [[SELECT2]](p3)
|
||||
; CHECK: $vgpr0_vgpr1_vgpr2 = COPY [[BUILD_VECTOR]](<3 x p3>)
|
||||
%0:_(s32) = G_CONSTANT i32 0
|
||||
%1:_(s32) = COPY $vgpr0
|
||||
%2:_(<3 x p3>) = COPY $vgpr1_vgpr2_vgpr3
|
||||
%3:_(<3 x p3>) = COPY $vgpr4_vgpr5_vgpr6
|
||||
|
||||
%4:_(s1) = G_ICMP intpred(ne), %0, %1
|
||||
%5:_(<3 x p3>) = G_SELECT %4, %2, %3
|
||||
$vgpr0_vgpr1_vgpr2 = COPY %5
|
||||
|
||||
...
|
||||
|
||||
---
|
||||
name: test_select_v4p3
|
||||
body: |
|
||||
bb.0:
|
||||
liveins: $vgpr0, $vgpr1_vgpr2_vgpr3_vgpr4, $vgpr5_vgpr6_vgpr7_vgpr8
|
||||
|
||||
; CHECK-LABEL: name: test_select_v4p3
|
||||
; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
|
||||
; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
|
||||
; CHECK: [[COPY1:%[0-9]+]]:_(<4 x p3>) = COPY $vgpr1_vgpr2_vgpr3_vgpr4
|
||||
; CHECK: [[COPY2:%[0-9]+]]:_(<4 x p3>) = COPY $vgpr5_vgpr6_vgpr7_vgpr8
|
||||
; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[C]](s32), [[COPY]]
|
||||
; CHECK: [[UV:%[0-9]+]]:_(<2 x p3>), [[UV1:%[0-9]+]]:_(<2 x p3>) = G_UNMERGE_VALUES [[COPY1]](<4 x p3>)
|
||||
; CHECK: [[UV2:%[0-9]+]]:_(<2 x p3>), [[UV3:%[0-9]+]]:_(<2 x p3>) = G_UNMERGE_VALUES [[COPY2]](<4 x p3>)
|
||||
; CHECK: [[SELECT:%[0-9]+]]:_(<2 x p3>) = G_SELECT [[ICMP]](s1), [[UV]], [[UV2]]
|
||||
; CHECK: [[SELECT1:%[0-9]+]]:_(<2 x p3>) = G_SELECT [[ICMP]](s1), [[UV1]], [[UV3]]
|
||||
; CHECK: [[CONCAT_VECTORS:%[0-9]+]]:_(<4 x p3>) = G_CONCAT_VECTORS [[SELECT]](<2 x p3>), [[SELECT1]](<2 x p3>)
|
||||
; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[CONCAT_VECTORS]](<4 x p3>)
|
||||
%0:_(s32) = G_CONSTANT i32 0
|
||||
%1:_(s32) = COPY $vgpr0
|
||||
%2:_(<4 x p3>) = COPY $vgpr1_vgpr2_vgpr3_vgpr4
|
||||
%3:_(<4 x p3>) = COPY $vgpr5_vgpr6_vgpr7_vgpr8
|
||||
|
||||
%4:_(s1) = G_ICMP intpred(ne), %0, %1
|
||||
%5:_(<4 x p3>) = G_SELECT %4, %2, %3
|
||||
$vgpr0_vgpr1_vgpr2_vgpr3 = COPY %5
|
||||
|
||||
...
|
||||
|
||||
---
|
||||
name: test_select_v4p5
|
||||
body: |
|
||||
bb.0:
|
||||
liveins: $vgpr0, $vgpr1_vgpr2_vgpr3_vgpr4, $vgpr5_vgpr6_vgpr7_vgpr8
|
||||
|
||||
; CHECK-LABEL: name: test_select_v4p5
|
||||
; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
|
||||
; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
|
||||
; CHECK: [[COPY1:%[0-9]+]]:_(<4 x p5>) = COPY $vgpr1_vgpr2_vgpr3_vgpr4
|
||||
; CHECK: [[COPY2:%[0-9]+]]:_(<4 x p5>) = COPY $vgpr5_vgpr6_vgpr7_vgpr8
|
||||
; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[C]](s32), [[COPY]]
|
||||
; CHECK: [[UV:%[0-9]+]]:_(<2 x p5>), [[UV1:%[0-9]+]]:_(<2 x p5>) = G_UNMERGE_VALUES [[COPY1]](<4 x p5>)
|
||||
; CHECK: [[UV2:%[0-9]+]]:_(<2 x p5>), [[UV3:%[0-9]+]]:_(<2 x p5>) = G_UNMERGE_VALUES [[COPY2]](<4 x p5>)
|
||||
; CHECK: [[SELECT:%[0-9]+]]:_(<2 x p5>) = G_SELECT [[ICMP]](s1), [[UV]], [[UV2]]
|
||||
; CHECK: [[SELECT1:%[0-9]+]]:_(<2 x p5>) = G_SELECT [[ICMP]](s1), [[UV1]], [[UV3]]
|
||||
; CHECK: [[CONCAT_VECTORS:%[0-9]+]]:_(<4 x p5>) = G_CONCAT_VECTORS [[SELECT]](<2 x p5>), [[SELECT1]](<2 x p5>)
|
||||
; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[CONCAT_VECTORS]](<4 x p5>)
|
||||
%0:_(s32) = G_CONSTANT i32 0
|
||||
%1:_(s32) = COPY $vgpr0
|
||||
%2:_(<4 x p5>) = COPY $vgpr1_vgpr2_vgpr3_vgpr4
|
||||
%3:_(<4 x p5>) = COPY $vgpr5_vgpr6_vgpr7_vgpr8
|
||||
|
||||
%4:_(s1) = G_ICMP intpred(ne), %0, %1
|
||||
%5:_(<4 x p5>) = G_SELECT %4, %2, %3
|
||||
$vgpr0_vgpr1_vgpr2_vgpr3 = COPY %5
|
||||
|
||||
...
|
||||
|
||||
---
|
||||
name: test_select_v2p0
|
||||
body: |
|
||||
bb.0:
|
||||
liveins: $vgpr0, $vgpr1_vgpr2_vgpr3_vgpr4, $vgpr5_vgpr6_vgpr7_vgpr8
|
||||
|
||||
; CHECK-LABEL: name: test_select_v2p0
|
||||
; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
|
||||
; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
|
||||
; CHECK: [[COPY1:%[0-9]+]]:_(<2 x p0>) = COPY $vgpr1_vgpr2_vgpr3_vgpr4
|
||||
; CHECK: [[COPY2:%[0-9]+]]:_(<2 x p0>) = COPY $vgpr5_vgpr6_vgpr7_vgpr8
|
||||
; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[C]](s32), [[COPY]]
|
||||
; CHECK: [[UV:%[0-9]+]]:_(p0), [[UV1:%[0-9]+]]:_(p0) = G_UNMERGE_VALUES [[COPY1]](<2 x p0>)
|
||||
; CHECK: [[UV2:%[0-9]+]]:_(p0), [[UV3:%[0-9]+]]:_(p0) = G_UNMERGE_VALUES [[COPY2]](<2 x p0>)
|
||||
; CHECK: [[SELECT:%[0-9]+]]:_(p0) = G_SELECT [[ICMP]](s1), [[UV]], [[UV2]]
|
||||
; CHECK: [[SELECT1:%[0-9]+]]:_(p0) = G_SELECT [[ICMP]](s1), [[UV1]], [[UV3]]
|
||||
; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x p0>) = G_BUILD_VECTOR [[SELECT]](p0), [[SELECT1]](p0)
|
||||
; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[BUILD_VECTOR]](<2 x p0>)
|
||||
%0:_(s32) = G_CONSTANT i32 0
|
||||
%1:_(s32) = COPY $vgpr0
|
||||
%2:_(<2 x p0>) = COPY $vgpr1_vgpr2_vgpr3_vgpr4
|
||||
%3:_(<2 x p0>) = COPY $vgpr5_vgpr6_vgpr7_vgpr8
|
||||
|
||||
%4:_(s1) = G_ICMP intpred(ne), %0, %1
|
||||
%5:_(<2 x p0>) = G_SELECT %4, %2, %3
|
||||
$vgpr0_vgpr1_vgpr2_vgpr3 = COPY %5
|
||||
|
||||
...
|
||||
|
||||
---
|
||||
name: test_select_v4p0
|
||||
body: |
|
||||
bb.0:
|
||||
liveins: $vgpr0, $vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7_vgpr8, $vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15_vgpr16
|
||||
|
||||
; CHECK-LABEL: name: test_select_v4p0
|
||||
; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
|
||||
; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
|
||||
; CHECK: [[COPY1:%[0-9]+]]:_(<4 x p0>) = COPY $vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7_vgpr8
|
||||
; CHECK: [[COPY2:%[0-9]+]]:_(<4 x p0>) = COPY $vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15_vgpr16
|
||||
; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[C]](s32), [[COPY]]
|
||||
; CHECK: [[UV:%[0-9]+]]:_(p0), [[UV1:%[0-9]+]]:_(p0), [[UV2:%[0-9]+]]:_(p0), [[UV3:%[0-9]+]]:_(p0) = G_UNMERGE_VALUES [[COPY1]](<4 x p0>)
|
||||
; CHECK: [[UV4:%[0-9]+]]:_(p0), [[UV5:%[0-9]+]]:_(p0), [[UV6:%[0-9]+]]:_(p0), [[UV7:%[0-9]+]]:_(p0) = G_UNMERGE_VALUES [[COPY2]](<4 x p0>)
|
||||
; CHECK: [[SELECT:%[0-9]+]]:_(p0) = G_SELECT [[ICMP]](s1), [[UV]], [[UV4]]
|
||||
; CHECK: [[SELECT1:%[0-9]+]]:_(p0) = G_SELECT [[ICMP]](s1), [[UV1]], [[UV5]]
|
||||
; CHECK: [[SELECT2:%[0-9]+]]:_(p0) = G_SELECT [[ICMP]](s1), [[UV2]], [[UV6]]
|
||||
; CHECK: [[SELECT3:%[0-9]+]]:_(p0) = G_SELECT [[ICMP]](s1), [[UV3]], [[UV7]]
|
||||
; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x p0>) = G_BUILD_VECTOR [[SELECT]](p0), [[SELECT1]](p0), [[SELECT2]](p0), [[SELECT3]](p0)
|
||||
; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 = COPY [[BUILD_VECTOR]](<4 x p0>)
|
||||
%0:_(s32) = G_CONSTANT i32 0
|
||||
%1:_(s32) = COPY $vgpr0
|
||||
%2:_(<4 x p0>) = COPY $vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7_vgpr8
|
||||
%3:_(<4 x p0>) = COPY $vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15_vgpr16
|
||||
|
||||
%4:_(s1) = G_ICMP intpred(ne), %0, %1
|
||||
%5:_(<4 x p0>) = G_SELECT %4, %2, %3
|
||||
$vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 = COPY %5
|
||||
|
||||
...
|
||||
|
||||
---
|
||||
name: test_select_v8p0
|
||||
body: |
|
||||
bb.0:
|
||||
liveins: $vgpr0
|
||||
|
||||
; CHECK-LABEL: name: test_select_v8p0
|
||||
; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
|
||||
; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
|
||||
; CHECK: [[DEF:%[0-9]+]]:_(<8 x p0>) = G_IMPLICIT_DEF
|
||||
; CHECK: [[DEF1:%[0-9]+]]:_(<8 x p0>) = G_IMPLICIT_DEF
|
||||
; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[C]](s32), [[COPY]]
|
||||
; CHECK: [[UV:%[0-9]+]]:_(p0), [[UV1:%[0-9]+]]:_(p0), [[UV2:%[0-9]+]]:_(p0), [[UV3:%[0-9]+]]:_(p0), [[UV4:%[0-9]+]]:_(p0), [[UV5:%[0-9]+]]:_(p0), [[UV6:%[0-9]+]]:_(p0), [[UV7:%[0-9]+]]:_(p0) = G_UNMERGE_VALUES [[DEF]](<8 x p0>)
|
||||
; CHECK: [[UV8:%[0-9]+]]:_(p0), [[UV9:%[0-9]+]]:_(p0), [[UV10:%[0-9]+]]:_(p0), [[UV11:%[0-9]+]]:_(p0), [[UV12:%[0-9]+]]:_(p0), [[UV13:%[0-9]+]]:_(p0), [[UV14:%[0-9]+]]:_(p0), [[UV15:%[0-9]+]]:_(p0) = G_UNMERGE_VALUES [[DEF1]](<8 x p0>)
|
||||
; CHECK: [[SELECT:%[0-9]+]]:_(p0) = G_SELECT [[ICMP]](s1), [[UV]], [[UV8]]
|
||||
; CHECK: [[SELECT1:%[0-9]+]]:_(p0) = G_SELECT [[ICMP]](s1), [[UV1]], [[UV9]]
|
||||
; CHECK: [[SELECT2:%[0-9]+]]:_(p0) = G_SELECT [[ICMP]](s1), [[UV2]], [[UV10]]
|
||||
; CHECK: [[SELECT3:%[0-9]+]]:_(p0) = G_SELECT [[ICMP]](s1), [[UV3]], [[UV11]]
|
||||
; CHECK: [[SELECT4:%[0-9]+]]:_(p0) = G_SELECT [[ICMP]](s1), [[UV4]], [[UV12]]
|
||||
; CHECK: [[SELECT5:%[0-9]+]]:_(p0) = G_SELECT [[ICMP]](s1), [[UV5]], [[UV13]]
|
||||
; CHECK: [[SELECT6:%[0-9]+]]:_(p0) = G_SELECT [[ICMP]](s1), [[UV6]], [[UV14]]
|
||||
; CHECK: [[SELECT7:%[0-9]+]]:_(p0) = G_SELECT [[ICMP]](s1), [[UV7]], [[UV15]]
|
||||
; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<8 x p0>) = G_BUILD_VECTOR [[SELECT]](p0), [[SELECT1]](p0), [[SELECT2]](p0), [[SELECT3]](p0), [[SELECT4]](p0), [[SELECT5]](p0), [[SELECT6]](p0), [[SELECT7]](p0)
|
||||
; CHECK: S_NOP 0, implicit [[BUILD_VECTOR]](<8 x p0>)
|
||||
%0:_(s32) = G_CONSTANT i32 0
|
||||
%1:_(s32) = COPY $vgpr0
|
||||
%2:_(<8 x p0>) = G_IMPLICIT_DEF
|
||||
%3:_(<8 x p0>) = G_IMPLICIT_DEF
|
||||
|
||||
%4:_(s1) = G_ICMP intpred(ne), %0, %1
|
||||
%5:_(<8 x p0>) = G_SELECT %4, %2, %3
|
||||
S_NOP 0, implicit %5
|
||||
|
||||
...
|
||||
|
||||
---
|
||||
name: test_vselect_v2s32
|
||||
body: |
|
||||
bb.0:
|
||||
liveins: $vgpr0_vgpr1, $vgpr2_vgpr3, $vgpr4_vgpr5, $vgpr6_vgpr7
|
||||
; CHECK-LABEL: name: test_vselect_v2s32
|
||||
; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
|
||||
; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr2_vgpr3
|
||||
; CHECK: [[COPY2:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr4_vgpr5
|
||||
; CHECK: [[COPY3:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr6_vgpr7
|
||||
; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
|
||||
; CHECK: [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<2 x s32>)
|
||||
; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV]](s32), [[UV2]]
|
||||
; CHECK: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV1]](s32), [[UV3]]
|
||||
; CHECK: [[UV4:%[0-9]+]]:_(s32), [[UV5:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY2]](<2 x s32>)
|
||||
; CHECK: [[UV6:%[0-9]+]]:_(s32), [[UV7:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY3]](<2 x s32>)
|
||||
; CHECK: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s1), [[UV4]], [[UV6]]
|
||||
; CHECK: [[SELECT1:%[0-9]+]]:_(s32) = G_SELECT [[ICMP1]](s1), [[UV5]], [[UV7]]
|
||||
; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[SELECT]](s32), [[SELECT1]](s32)
|
||||
; CHECK: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>)
|
||||
%0:_(<2 x s32>) = COPY $vgpr0_vgpr1
|
||||
%1:_(<2 x s32>) = COPY $vgpr2_vgpr3
|
||||
%2:_(<2 x s32>) = COPY $vgpr4_vgpr5
|
||||
%3:_(<2 x s32>) = COPY $vgpr6_vgpr7
|
||||
|
||||
%4:_(<2 x s1>) = G_ICMP intpred(ne), %0, %1
|
||||
%5:_(<2 x s32>) = G_SELECT %4, %2, %3
|
||||
$vgpr0_vgpr1 = COPY %5
|
||||
|
||||
...
|
||||
|
||||
---
|
||||
name: test_vselect_v3s32
|
||||
body: |
|
||||
|
@ -358,33 +765,64 @@ body: |
|
|||
...
|
||||
|
||||
---
|
||||
name: test_vselect_v2s32
|
||||
name: test_vselect_v2p3
|
||||
body: |
|
||||
bb.0:
|
||||
liveins: $vgpr0_vgpr1, $vgpr2_vgpr3, $vgpr4_vgpr5, $vgpr6_vgpr7
|
||||
; CHECK-LABEL: name: test_vselect_v2s32
|
||||
; CHECK-LABEL: name: test_vselect_v2p3
|
||||
; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
|
||||
; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr2_vgpr3
|
||||
; CHECK: [[COPY2:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr4_vgpr5
|
||||
; CHECK: [[COPY3:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr6_vgpr7
|
||||
; CHECK: [[COPY2:%[0-9]+]]:_(<2 x p3>) = COPY $vgpr4_vgpr5
|
||||
; CHECK: [[COPY3:%[0-9]+]]:_(<2 x p3>) = COPY $vgpr6_vgpr7
|
||||
; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
|
||||
; CHECK: [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<2 x s32>)
|
||||
; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV]](s32), [[UV2]]
|
||||
; CHECK: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV1]](s32), [[UV3]]
|
||||
; CHECK: [[UV4:%[0-9]+]]:_(s32), [[UV5:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY2]](<2 x s32>)
|
||||
; CHECK: [[UV6:%[0-9]+]]:_(s32), [[UV7:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY3]](<2 x s32>)
|
||||
; CHECK: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s1), [[UV4]], [[UV6]]
|
||||
; CHECK: [[SELECT1:%[0-9]+]]:_(s32) = G_SELECT [[ICMP1]](s1), [[UV5]], [[UV7]]
|
||||
; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[SELECT]](s32), [[SELECT1]](s32)
|
||||
; CHECK: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>)
|
||||
; CHECK: [[UV4:%[0-9]+]]:_(p3), [[UV5:%[0-9]+]]:_(p3) = G_UNMERGE_VALUES [[COPY2]](<2 x p3>)
|
||||
; CHECK: [[UV6:%[0-9]+]]:_(p3), [[UV7:%[0-9]+]]:_(p3) = G_UNMERGE_VALUES [[COPY3]](<2 x p3>)
|
||||
; CHECK: [[SELECT:%[0-9]+]]:_(p3) = G_SELECT [[ICMP]](s1), [[UV4]], [[UV6]]
|
||||
; CHECK: [[SELECT1:%[0-9]+]]:_(p3) = G_SELECT [[ICMP1]](s1), [[UV5]], [[UV7]]
|
||||
; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x p3>) = G_BUILD_VECTOR [[SELECT]](p3), [[SELECT1]](p3)
|
||||
; CHECK: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x p3>)
|
||||
%0:_(<2 x s32>) = COPY $vgpr0_vgpr1
|
||||
%1:_(<2 x s32>) = COPY $vgpr2_vgpr3
|
||||
%2:_(<2 x s32>) = COPY $vgpr4_vgpr5
|
||||
%3:_(<2 x s32>) = COPY $vgpr6_vgpr7
|
||||
%2:_(<2 x p3>) = COPY $vgpr4_vgpr5
|
||||
%3:_(<2 x p3>) = COPY $vgpr6_vgpr7
|
||||
|
||||
%4:_(<2 x s1>) = G_ICMP intpred(ne), %0, %1
|
||||
%5:_(<2 x s32>) = G_SELECT %4, %2, %3
|
||||
%5:_(<2 x p3>) = G_SELECT %4, %2, %3
|
||||
$vgpr0_vgpr1 = COPY %5
|
||||
|
||||
...
|
||||
|
||||
---
|
||||
name: test_vselect_v2p0
|
||||
body: |
|
||||
bb.0:
|
||||
liveins: $vgpr0_vgpr1_vgpr2_vgpr3, $vgpr4_vgpr5_vgpr6_vgpr7, $vgpr8_vgpr9_vgpr10_vgpr11, $vgpr12_vgpr13_vgpr14_vgpr15
|
||||
|
||||
; CHECK-LABEL: name: test_vselect_v2p0
|
||||
; CHECK: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
|
||||
; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s64>) = COPY $vgpr4_vgpr5_vgpr6_vgpr7
|
||||
; CHECK: [[COPY2:%[0-9]+]]:_(<2 x p0>) = COPY $vgpr8_vgpr9_vgpr10_vgpr11
|
||||
; CHECK: [[COPY3:%[0-9]+]]:_(<2 x p0>) = COPY $vgpr12_vgpr13_vgpr14_vgpr15
|
||||
; CHECK: [[UV:%[0-9]+]]:_(s64), [[UV1:%[0-9]+]]:_(s64) = G_UNMERGE_VALUES [[COPY]](<2 x s64>)
|
||||
; CHECK: [[UV2:%[0-9]+]]:_(s64), [[UV3:%[0-9]+]]:_(s64) = G_UNMERGE_VALUES [[COPY1]](<2 x s64>)
|
||||
; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV]](s64), [[UV2]]
|
||||
; CHECK: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV1]](s64), [[UV3]]
|
||||
; CHECK: [[UV4:%[0-9]+]]:_(p0), [[UV5:%[0-9]+]]:_(p0) = G_UNMERGE_VALUES [[COPY2]](<2 x p0>)
|
||||
; CHECK: [[UV6:%[0-9]+]]:_(p0), [[UV7:%[0-9]+]]:_(p0) = G_UNMERGE_VALUES [[COPY3]](<2 x p0>)
|
||||
; CHECK: [[SELECT:%[0-9]+]]:_(p0) = G_SELECT [[ICMP]](s1), [[UV4]], [[UV6]]
|
||||
; CHECK: [[SELECT1:%[0-9]+]]:_(p0) = G_SELECT [[ICMP1]](s1), [[UV5]], [[UV7]]
|
||||
; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x p0>) = G_BUILD_VECTOR [[SELECT]](p0), [[SELECT1]](p0)
|
||||
; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[BUILD_VECTOR]](<2 x p0>)
|
||||
%0:_(<2 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
|
||||
%1:_(<2 x s64>) = COPY $vgpr4_vgpr5_vgpr6_vgpr7
|
||||
%2:_(<2 x p0>) = COPY $vgpr8_vgpr9_vgpr10_vgpr11
|
||||
%3:_(<2 x p0>) = COPY $vgpr12_vgpr13_vgpr14_vgpr15
|
||||
|
||||
%4:_(<2 x s1>) = G_ICMP intpred(ne), %0, %1
|
||||
%5:_(<2 x p0>) = G_SELECT %4, %2, %3
|
||||
$vgpr0_vgpr1_vgpr2_vgpr3 = COPY %5
|
||||
|
||||
...
|
||||
|
|
Loading…
Reference in New Issue