Skip to content

Commit 465c393

Browse files
committed
[LV] Use requested calling convention for vector math routines
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 927a0cb commit 465c393

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
@@ -1206,6 +1206,7 @@ void VPIRPhi::print(raw_ostream &O, const Twine &Indent,
12061206

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

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

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

12321231
CallInst *V = State.Builder.CreateCall(Variant, Args, OpBundles);
12331232
setFlags(V);
1233+
V->setCallingConv(Variant->getCallingConv());
12341234

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

0 commit comments

Comments
 (0)