Skip to content

Commit 5247959

Browse files
authored
AMDGPU: Enable vectorization of v2f16 copysign (#100799)
1 parent 4ed66cb commit 5247959

File tree

3 files changed

+139
-136
lines changed

3 files changed

+139
-136
lines changed

llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,7 @@ static bool intrinsicHasPackedVectorBenefit(Intrinsic::ID ID) {
688688
switch (ID) {
689689
case Intrinsic::fma:
690690
case Intrinsic::fmuladd:
691+
case Intrinsic::copysign:
691692
// There's a small benefit to using vector ops in the legalized code.
692693
case Intrinsic::round:
693694
case Intrinsic::uadd_sat:
@@ -739,6 +740,8 @@ GCNTTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
739740
: getQuarterRateInstrCost(CostKind);
740741
}
741742
break;
743+
case Intrinsic::copysign:
744+
return NElts * getFullRateInstrCost();
742745
case Intrinsic::uadd_sat:
743746
case Intrinsic::usub_sat:
744747
case Intrinsic::sadd_sat:

0 commit comments

Comments
 (0)