Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6262,7 +6262,6 @@ void LoopVectorizationCostModel::setVectorizedCallDecision(ElementCount VF) {

// Find the cost of vectorizing the call, if we can find a suitable
// vector variant of the function.
bool UsesMask = false;
VFInfo FuncInfo;
Function *VecFunc = nullptr;
// Search through any available variants for one we can use at this VF.
Expand Down Expand Up @@ -6314,7 +6313,6 @@ void LoopVectorizationCostModel::setVectorizedCallDecision(ElementCount VF) {
break;
}
case VFParamKind::GlobalPredicate:
UsesMask = true;
break;
default:
ParamsOk = false;
Expand All @@ -6331,19 +6329,8 @@ void LoopVectorizationCostModel::setVectorizedCallDecision(ElementCount VF) {
break;
}

// Add in the cost of synthesizing a mask if one wasn't required.
InstructionCost MaskCost = 0;
if (VecFunc && UsesMask && !MaskRequired)
MaskCost = TTI.getShuffleCost(
TargetTransformInfo::SK_Broadcast,
VectorType::get(IntegerType::getInt1Ty(
VecFunc->getFunctionType()->getContext()),
VF),
{}, CostKind);

if (TLI && VecFunc && !CI->isNoBuiltin())
VectorCost =
TTI.getCallInstrCost(nullptr, RetTy, Tys, CostKind) + MaskCost;
VectorCost = TTI.getCallInstrCost(nullptr, RetTy, Tys, CostKind);

// Find the cost of an intrinsic; some targets may have instructions that
// perform the operation without needing an actual call.
Expand Down
Loading