Skip to content

Commit dcfe7be

Browse files
committed
Use isWaveSizeKnown instead of gnarly hack.
1 parent d30cb95 commit dcfe7be

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,13 +1025,10 @@ GCNTTIImpl::instCombineIntrinsic(InstCombiner &IC, IntrinsicInst &II) const {
10251025
break;
10261026
}
10271027
case Intrinsic::amdgcn_wavefrontsize: {
1028-
// TODO: this is a workaround for the pseudo-generic target one gets with no
1029-
// specified mcpu, which spoofs its wave size to 64; it should be removed.
1030-
if ((ST->getCPU().empty() || ST->getCPU().starts_with("generic")) &&
1031-
!ST->getFeatureString().contains("+wavefrontsize"))
1032-
break;
1033-
return IC.replaceInstUsesWith(
1034-
II, ConstantInt::get(II.getType(), ST->getWavefrontSize()));
1028+
if (ST->isWaveSizeKnown())
1029+
return IC.replaceInstUsesWith(
1030+
II, ConstantInt::get(II.getType(), ST->getWavefrontSize()));
1031+
break;
10351032
}
10361033
case Intrinsic::amdgcn_wqm_vote: {
10371034
// wqm_vote is identity when the argument is constant.

0 commit comments

Comments
 (0)