Skip to content

Commit 63a8bdb

Browse files
committed
remove undef folding to move it forward
1 parent e35cd55 commit 63a8bdb

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4007,8 +4007,7 @@ SDValue AMDGPUTargetLowering::performIntrinsicWOChainCombine(
40074007
case Intrinsic::amdgcn_rcp_legacy:
40084008
case Intrinsic::amdgcn_rsq_legacy:
40094009
case Intrinsic::amdgcn_rsq_clamp:
4010-
case Intrinsic::amdgcn_tanh:
4011-
case Intrinsic::amdgcn_prng_b32: {
4010+
case Intrinsic::amdgcn_tanh: {
40124011
// FIXME: This is probably wrong. If src is an sNaN, it won't be quieted
40134012
SDValue Src = N->getOperand(1);
40144013
return Src.isUndef() ? Src : SDValue();

llvm/test/CodeGen/AMDGPU/llvm.amdgcn.prng.ll

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; RUN: llc -global-isel=0 -mtriple=amdgcn -mcpu=gfx950 -verify-machineinstrs < %s | FileCheck -check-prefixes=GCN %s
22
; RUN: llc -global-isel=1 -mtriple=amdgcn -mcpu=gfx950 -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
3-
; RUN: llc -global-isel=0 -mtriple=amdgcn -mcpu=gfx1250 < %s | FileCheck -check-prefixes=GCN,SDAG %s
3+
; RUN: llc -global-isel=0 -mtriple=amdgcn -mcpu=gfx1250 < %s | FileCheck -check-prefixes=GCN %s
44
; RUN: llc -global-isel=1 -mtriple=amdgcn -mcpu=gfx1250 < %s | FileCheck -check-prefix=GCN %s
55

66
declare i32 @llvm.amdgcn.prng.b32(i32) #0
@@ -29,13 +29,6 @@ define amdgpu_kernel void @prng_b32_constant_100(ptr addrspace(1) %out) #1 {
2929
ret void
3030
}
3131

32-
; GCN-LABEL: {{^}}prng_undef_i32:
33-
; SDAG-NOT: v_prng_b32
34-
define amdgpu_kernel void @prng_undef_i32(ptr addrspace(1) %out) #1 {
35-
%prng = call i32 @llvm.amdgcn.prng.b32(i32 undef)
36-
store i32 %prng, ptr addrspace(1) %out, align 4
37-
ret void
38-
}
3932

4033
attributes #0 = { nounwind readnone }
4134
attributes #1 = { nounwind }

0 commit comments

Comments
 (0)