diff options
author | Wenlei He <aktoon@gmail.com> | 2020-04-06 23:54:14 -0700 |
---|---|---|
committer | Wenlei He <aktoon@gmail.com> | 2020-04-09 18:26:38 -0700 |
commit | 60c642e74be6af86906d9f3d982728be7bd4329f (patch) | |
tree | caf898130d11d7ad852dbb8d2adbc5c693a565fe /llvm/lib/Analysis/InlineCost.cpp | |
parent | 5b18b6e9a84d985c0a907009fb71de7c1943bc88 (diff) | |
download | llvm-60c642e74be6af86906d9f3d982728be7bd4329f.zip llvm-60c642e74be6af86906d9f3d982728be7bd4329f.tar.gz llvm-60c642e74be6af86906d9f3d982728be7bd4329f.tar.bz2 |
[TLI] Per-function fveclib for math library used for vectorization
Summary:
Encode `-fveclib` setting as per-function attribute so it can threaded through to LTO backends. Accordingly per-function TLI now reads
the attributes and select available vector function list based on that. Now we also populate function list for all supported vector
libraries for the shared per-module `TargetLibraryInfoImpl`, so each function can select its available vector list independently but without
duplicating the vector function lists. Inlining between incompatbile vectlib attributed is also prohibited now.
Subscribers: hiraditya, dexonsmith, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77632
Diffstat (limited to 'llvm/lib/Analysis/InlineCost.cpp')
-rw-r--r-- | llvm/lib/Analysis/InlineCost.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp index b9f0699..a96047a 100644 --- a/llvm/lib/Analysis/InlineCost.cpp +++ b/llvm/lib/Analysis/InlineCost.cpp @@ -104,10 +104,9 @@ static cl::opt<bool> OptComputeFullInlineCost( cl::desc("Compute the full inline cost of a call site even when the cost " "exceeds the threshold.")); -static cl::opt<bool> InlineCallerSupersetNoBuiltin( - "inline-caller-superset-nobuiltin", cl::Hidden, cl::init(true), - cl::ZeroOrMore, - cl::desc("Allow inlining when caller has a superset of callee's nobuiltin " +static cl::opt<bool> InlineCallerSupersetTLI( + "inline-caller-superset-tli", cl::Hidden, cl::init(true), cl::ZeroOrMore, + cl::desc("Allow inlining when caller has a superset of callee's TLI " "attributes.")); namespace { @@ -2169,7 +2168,7 @@ static bool functionsHaveCompatibleAttributes( auto CalleeTLI = GetTLI(*Callee); return TTI.areInlineCompatible(Caller, Callee) && GetTLI(*Caller).areInlineCompatible(CalleeTLI, - InlineCallerSupersetNoBuiltin) && + InlineCallerSupersetTLI) && AttributeFuncs::areInlineCompatible(*Caller, *Callee); } |