Skip to content

Commit 1cf9acd

Browse files
authored
[TLI] Use AArch64 vector calling convention for ArmPL routines (#135790)
Some ArmPL vector math routines that operate on fixed-width vector types obey the aarch64_vector_pcs calling convention, e.g. armpl_vsinq_f64, etc. This patch adds support for functions in the TLI to specify an optional calling convention to be added to the declared function. Once this patch lands I intend to follow up with a vectoriser patch that adds this optional calling convention when invoking the vector library variant from the loop vectoriser.
1 parent 34f9ddf commit 1cf9acd

File tree

6 files changed

+326
-320
lines changed

6 files changed

+326
-320
lines changed

llvm/include/llvm/Analysis/TargetLibraryInfo.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,23 @@ class VecDesc {
4545
ElementCount VectorizationFactor;
4646
bool Masked;
4747
StringRef VABIPrefix;
48+
std::optional<CallingConv::ID> CC;
4849

4950
public:
5051
VecDesc() = delete;
5152
VecDesc(StringRef ScalarFnName, StringRef VectorFnName,
52-
ElementCount VectorizationFactor, bool Masked, StringRef VABIPrefix)
53+
ElementCount VectorizationFactor, bool Masked, StringRef VABIPrefix,
54+
std::optional<CallingConv::ID> Conv)
5355
: ScalarFnName(ScalarFnName), VectorFnName(VectorFnName),
5456
VectorizationFactor(VectorizationFactor), Masked(Masked),
55-
VABIPrefix(VABIPrefix) {}
57+
VABIPrefix(VABIPrefix), CC(Conv) {}
5658

5759
StringRef getScalarFnName() const { return ScalarFnName; }
5860
StringRef getVectorFnName() const { return VectorFnName; }
5961
ElementCount getVectorizationFactor() const { return VectorizationFactor; }
6062
bool isMasked() const { return Masked; }
6163
StringRef getVABIPrefix() const { return VABIPrefix; }
64+
std::optional<CallingConv::ID> getCallingConv() const { return CC; }
6265

6366
/// Returns a vector function ABI variant string on the form:
6467
/// _ZGV<isa><mask><vlen><vparams>_<scalarname>(<vectorname>)

0 commit comments

Comments
 (0)