[TLI] Per-function fveclib for math library used for vectorization
authorWenlei He <aktoon@gmail.com>
Tue, 7 Apr 2020 06:54:14 +0000 (23:54 -0700)
committerWenlei He <aktoon@gmail.com>
Fri, 10 Apr 2020 01:26:38 +0000 (18:26 -0700)
commit60c642e74be6af86906d9f3d982728be7bd4329f
treecaf898130d11d7ad852dbb8d2adbc5c693a565fe
parent5b18b6e9a84d985c0a907009fb71de7c1943bc88
[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
clang/lib/CodeGen/BackendUtil.cpp
clang/lib/CodeGen/CGCall.cpp
clang/test/CodeGen/libcalls-veclib.c [new file with mode: 0644]
llvm/include/llvm/Analysis/TargetLibraryInfo.h
llvm/lib/Analysis/InlineCost.cpp
llvm/lib/Analysis/TargetLibraryInfo.cpp
llvm/test/Transforms/Inline/inline-no-builtin-compatible.ll
llvm/test/Transforms/Inline/veclib-compat.ll [new file with mode: 0644]