diff options
-rw-r--r-- | llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp | 3 | ||||
-rw-r--r-- | llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-implicit-def.mir | 28 |
2 files changed, 30 insertions, 1 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp b/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp index 02528b62177..0002aece557 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp @@ -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 diff --git a/llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-implicit-def.mir b/llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-implicit-def.mir index 786ec1335be..b9a27740c89 100644 --- a/llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-implicit-def.mir +++ b/llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-implicit-def.mir @@ -70,6 +70,20 @@ body: | ... --- +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: | bb.0: @@ -82,6 +96,20 @@ body: | ... --- +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: | bb.0: |