AMDGPU/GlobalISel: Fix non-power-of-2 implicit_def

llvm-svn: 353522
This commit is contained in:
Matt Arsenault 2019-02-08 14:46:27 +00:00
parent e08fe35d79
commit 0f2debb1c2
2 changed files with 30 additions and 1 deletions

View File

@ -139,7 +139,8 @@ AMDGPULegalizerInfo::AMDGPULegalizerInfo(const GCNSubtarget &ST,
ConstantPtr, LocalPtr, FlatPtr, PrivatePtr})
.legalFor({LLT::vector(3, 16)})// FIXME: Hack
.clampScalarOrElt(0, S32, S512)
.legalIf(isMultiple32(0));
.legalIf(isMultiple32(0))
.widenScalarToNextPow2(0, 32);
// FIXME: i1 operands to intrinsics should always be legal, but other i1

View File

@ -69,6 +69,20 @@ body: |
$vgpr0 = COPY %0
...
---
name: test_implicit_def_48
body: |
bb.0:
; CHECK-LABEL: name: test_implicit_def_48
; CHECK: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY [[DEF]](s64)
; CHECK: $vgpr0_vgpr1 = COPY [[COPY]](s64)
%0:_(s48) = G_IMPLICIT_DEF
%1:_(s64) = G_ANYEXT %0
$vgpr0_vgpr1 = COPY %1
...
---
name: test_implicit_def_s64
body: |
@ -81,6 +95,20 @@ body: |
$vgpr0_vgpr1 = COPY %0
...
---
name: test_implicit_def_s65
body: |
bb.0:
; CHECK-LABEL: name: test_implicit_def_s65
; CHECK: [[DEF:%[0-9]+]]:_(s128) = G_IMPLICIT_DEF
; CHECK: [[TRUNC:%[0-9]+]]:_(s96) = G_TRUNC [[DEF]](s128)
; CHECK: $vgpr0_vgpr1_vgpr2 = COPY [[TRUNC]](s96)
%0:_(s65) = G_IMPLICIT_DEF
%1:_(s96) = G_ANYEXT %0
$vgpr0_vgpr1_vgpr2 = COPY %1
...
---
name: test_implicit_def_s128
body: |