Skip to content

Commit 052eca9

Browse files
authored
AMDGPU: Replace unused update.dpp inputs with poison instead of undef (#131287)
1 parent 8392573 commit 052eca9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,11 +1103,11 @@ GCNTTIImpl::instCombineIntrinsic(InstCombiner &IC, IntrinsicInst &II) const {
11031103
auto *RM = cast<ConstantInt>(II.getArgOperand(3));
11041104
auto *BM = cast<ConstantInt>(II.getArgOperand(4));
11051105
if (BC->isZeroValue() || RM->getZExtValue() != 0xF ||
1106-
BM->getZExtValue() != 0xF || isa<UndefValue>(Old))
1106+
BM->getZExtValue() != 0xF || isa<PoisonValue>(Old))
11071107
break;
11081108

11091109
// If bound_ctrl = 1, row mask = bank mask = 0xf we can omit old value.
1110-
return IC.replaceOperand(II, 0, UndefValue::get(Old->getType()));
1110+
return IC.replaceOperand(II, 0, PoisonValue::get(Old->getType()));
11111111
}
11121112
case Intrinsic::amdgcn_permlane16:
11131113
case Intrinsic::amdgcn_permlane16_var:

llvm/test/Transforms/InstCombine/AMDGPU/amdgcn-intrinsics.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3232,7 +3232,7 @@ define amdgpu_kernel void @update_dpp_no_combine(ptr addrspace(1) %out, i32 %in1
32323232

32333233
define amdgpu_kernel void @update_dpp_drop_old(ptr addrspace(1) %out, i32 %in1, i32 %in2) {
32343234
; CHECK-LABEL: @update_dpp_drop_old(
3235-
; CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.amdgcn.update.dpp.i32(i32 undef, i32 [[IN2:%.*]], i32 3, i32 15, i32 15, i1 true)
3235+
; CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.amdgcn.update.dpp.i32(i32 poison, i32 [[IN2:%.*]], i32 3, i32 15, i32 15, i1 true)
32363236
; CHECK-NEXT: store i32 [[TMP0]], ptr addrspace(1) [[OUT:%.*]], align 4
32373237
; CHECK-NEXT: ret void
32383238
;
@@ -3243,7 +3243,7 @@ define amdgpu_kernel void @update_dpp_drop_old(ptr addrspace(1) %out, i32 %in1,
32433243

32443244
define amdgpu_kernel void @update_dpp_undef_old(ptr addrspace(1) %out, i32 %in1) {
32453245
; CHECK-LABEL: @update_dpp_undef_old(
3246-
; CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.amdgcn.update.dpp.i32(i32 undef, i32 [[IN1:%.*]], i32 4, i32 15, i32 15, i1 true)
3246+
; CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.amdgcn.update.dpp.i32(i32 poison, i32 [[IN1:%.*]], i32 4, i32 15, i32 15, i1 true)
32473247
; CHECK-NEXT: store i32 [[TMP0]], ptr addrspace(1) [[OUT:%.*]], align 4
32483248
; CHECK-NEXT: ret void
32493249
;

0 commit comments

Comments
 (0)