summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/TargetLibraryInfo.cpp
diff options
context:
space:
mode:
authorFrancesco Petrogalli <francesco.petrogalli@arm.com>2019-11-11 19:42:18 +0000
committerFrancesco Petrogalli <francesco.petrogalli@arm.com>2019-11-15 18:42:56 +0000
commitd6de5f12d485a85504bc99d384a85634574a27e2 (patch)
treeb0833f4c77a6c8a7d4dc6debcaae45582b6c3dd3 /llvm/lib/Analysis/TargetLibraryInfo.cpp
parent209e30b7e0c20796f8f2c941d13e7e4994479c6b (diff)
downloadbcm5719-llvm-d6de5f12d485a85504bc99d384a85634574a27e2.tar.gz
bcm5719-llvm-d6de5f12d485a85504bc99d384a85634574a27e2.zip
[SVFS] Inject TLI Mappings in VFABI attribute.
This patch introduces a function pass to inject the scalar-to-vector mappings stored in the TargetLIbraryInfo (TLI) into the Vector Function ABI (VFABI) variants attribute. The test is testing the injection for three vector libraries supported by the TLI (Accelerate, SVML, MASSV). The pass does not change any of the analysis associated to the function. Differential Revision: https://reviews.llvm.org/D70107
Diffstat (limited to 'llvm/lib/Analysis/TargetLibraryInfo.cpp')
-rw-r--r--llvm/lib/Analysis/TargetLibraryInfo.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/TargetLibraryInfo.cpp b/llvm/lib/Analysis/TargetLibraryInfo.cpp
index 0d0e8f1eeca..f1d4268ad42 100644
--- a/llvm/lib/Analysis/TargetLibraryInfo.cpp
+++ b/llvm/lib/Analysis/TargetLibraryInfo.cpp
@@ -1637,3 +1637,19 @@ INITIALIZE_PASS(TargetLibraryInfoWrapperPass, "targetlibinfo",
char TargetLibraryInfoWrapperPass::ID = 0;
void TargetLibraryInfoWrapperPass::anchor() {}
+
+unsigned TargetLibraryInfoImpl::getWidestVF(StringRef ScalarF) const {
+ ScalarF = sanitizeFunctionName(ScalarF);
+ if (ScalarF.empty())
+ return 1;
+
+ unsigned VF = 1;
+ std::vector<VecDesc>::const_iterator I =
+ llvm::lower_bound(VectorDescs, ScalarF, compareWithScalarFnName);
+ while (I != VectorDescs.end() && StringRef(I->ScalarFnName) == ScalarF) {
+ if (I->VectorizationFactor > VF)
+ VF = I->VectorizationFactor;
+ ++I;
+ }
+ return VF;
+}
OpenPOWER on IntegriCloud