Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
Show First 20 Lines • Show All 1,330 Lines • ▼ Show 20 Lines | case Intrinsic::ppc_vsx_stxvp: { | ||||
Info.WriteMem = true; | Info.WriteMem = true; | ||||
return true; | return true; | ||||
} | } | ||||
default: | default: | ||||
break; | break; | ||||
} | } | ||||
return false; | return false; | ||||
} | } | ||||
TTI::VPLegalization | |||||
PPCTTIImpl::getVPLegalizationStrategy(const VPIntrinsic &PI) const { | |||||
auto Legal = TargetTransformInfo::VPLegalization( | |||||
/* EVLParamStrategy */ TargetTransformInfo::VPLegalization::Legal, | |||||
/* OperatorStrategy */ TargetTransformInfo::VPLegalization::Legal); | |||||
auto Illegal = BaseT::getVPLegalizationStrategy(PI); | |||||
// Masks are unsupported. | |||||
if (!isa<UndefValue>(PI.getMaskParam())) | |||||
return Illegal; | |||||
switch (PI.getIntrinsicID()) { | |||||
default: | |||||
return Illegal; | |||||
case Intrinsic::vp_load: | |||||
case Intrinsic::vp_store: { | |||||
// We currently don't support the target-independent interface for Altivec. | |||||
// Loads/stores with length instructions use bits 0-7 of the GPR operand and | |||||
// therefore cannot be used in 32-bit mode. | |||||
if ((!ST->hasP9Vector() && !ST->hasP10Vector()) || !ST->isPPC64()) | |||||
return Illegal; | |||||
Type *DataType = PI.getIntrinsicID() == Intrinsic::vp_load | |||||
? PI.getType() | |||||
: PI.getMemoryDataParam()->getType(); | |||||
if (isa<FixedVectorType>(DataType)) { | |||||
// auto *VecTy = dyn_cast<FixedVectorType>(DataType); | |||||
unsigned VecWidth = DataType->getPrimitiveSizeInBits(); | |||||
return VecWidth == 128 ? Legal : Illegal; | |||||
} | |||||
Type *ScalarTy = DataType->getScalarType(); | |||||
if (ScalarTy->isPointerTy()) | |||||
return Legal; | |||||
if (ScalarTy->isFloatTy() || ScalarTy->isDoubleTy()) | |||||
return Legal; | |||||
if (!ScalarTy->isIntegerTy()) | |||||
return Illegal; | |||||
unsigned IntWidth = ScalarTy->getIntegerBitWidth(); | |||||
if (IntWidth == 8 || IntWidth == 16 || IntWidth == 32 || IntWidth == 64) | |||||
return Legal; | |||||
return Illegal; | |||||
} | |||||
} | |||||
} | |||||
bmahjour: in what patch is this function first introduced? I don't see it in main or any of the other… | |||||
Not Done ReplyInline ActionsThis is a target specialization of the default function from https://reviews.llvm.org/D78203. RolandF: This is a target specialization of the default function from https://reviews.llvm.org/D78203. |
in what patch is this function first introduced? I don't see it in main or any of the other recent patches you posted.