Skip to content

Commit ef72b93

Browse files
authored
[LV] Use requested calling convention for vector math routines (#136122)
Some vector math routines, e.g. ArmPL, specify a particular calling convention on the routines which can help improve performance by specifying what registers have to be preserved across the call.
1 parent f541a3a commit ef72b93

File tree

3 files changed

+116
-116
lines changed

3 files changed

+116
-116
lines changed

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,6 +1207,7 @@ void VPIRPhi::print(raw_ostream &O, const Twine &Indent,
12071207

12081208
void VPWidenCallRecipe::execute(VPTransformState &State) {
12091209
assert(State.VF.isVector() && "not widening");
1210+
assert(Variant != nullptr && "Can't create vector function.");
12101211

12111212
FunctionType *VFTy = Variant->getFunctionType();
12121213
// Add return type if intrinsic is overloaded on it.
@@ -1223,15 +1224,14 @@ void VPWidenCallRecipe::execute(VPTransformState &State) {
12231224
Args.push_back(Arg);
12241225
}
12251226

1226-
assert(Variant != nullptr && "Can't create vector function.");
1227-
12281227
auto *CI = cast_or_null<CallInst>(getUnderlyingValue());
12291228
SmallVector<OperandBundleDef, 1> OpBundles;
12301229
if (CI)
12311230
CI->getOperandBundlesAsDefs(OpBundles);
12321231

12331232
CallInst *V = State.Builder.CreateCall(Variant, Args, OpBundles);
12341233
applyFlags(*V);
1234+
V->setCallingConv(Variant->getCallingConv());
12351235

12361236
if (!V->getType()->isVoidTy())
12371237
State.set(this, V);

0 commit comments

Comments
 (0)