llvm-project/llvm
Jonas Paulsson 0f8c626723 [BuildLibCalls] Introduce getOrInsertLibFunc() for use when building libcalls.
A new set of overloaded functions named getOrInsertLibFunc() are now supposed
to be used instead of getOrInsertFunction() when building a libcall from
within an LLVM optimizer(). The idea is that this new function also makes
sure that any mandatory argument attributes are added to the function
prototype (after calling getOrInsertFunction()).

inferLibFuncAttributes() is renamed to inferNonMandatoryLibFuncAttrs() as it
only adds attributes that are not necessary for correctness but merely
helping with later optimizations.

Generally, the front end is responsible for building a correct function
prototype with the needed argument attributes. If the middle end however is
the one creating the call, e.g. when replacing one libcall with another, it
then must take this responsibility.

This continues the work of properly handling argument extension if required
by the target ABI when building a lib call. getOrInsertLibFunc() now does
this for all libcalls currently built by any LLVM optimizer. It is expected
that when in the future a new optimization builds a new libcall with an
integer argument it is to be added to getOrInsertLibFunc() with the proper
handling. Note that not all targets have it in their ABI to sign/zero extend
integer arguments to the full register width, but this will be done
selectively as determined by getExtAttrForI32Param().

Review: Eli Friedman, Nikita Popov, Dávid Bolvanský

Differential Revision: https://reviews.llvm.org/D123198
2022-04-19 21:22:07 +02:00
..
benchmarks
bindings [Go] Remove PopulateLTOPassManager binding after D123882 2022-04-19 11:16:27 -07:00
cmake [cmake] Loosen multi-distribution restrictions 2022-04-13 20:33:28 -07:00
docs [DebugInfo] Add a TargetFuncName field in DISubprogram for 2022-04-15 16:38:23 -04:00
examples [examples][ORC] Add a new example showing the ORCv2 removable code APIs. 2022-04-12 15:05:07 -07:00
include [BuildLibCalls] Introduce getOrInsertLibFunc() for use when building libcalls. 2022-04-19 21:22:07 +02:00
lib [BuildLibCalls] Introduce getOrInsertLibFunc() for use when building libcalls. 2022-04-19 21:22:07 +02:00
projects
resources
runtimes Revert "[runtimes] Create Tests.cmake if it does not exist" 2022-04-01 09:29:54 -07:00
test [BuildLibCalls] Introduce getOrInsertLibFunc() for use when building libcalls. 2022-04-19 21:22:07 +02:00
tools [llvm-objcopy] Make llvm-strip --only-keep-debug suppress default --strip-all 2022-04-18 14:16:10 -07:00
unittests Reapply "[OpenMP] Refactor OMPScheduleType enum." 2022-04-18 21:56:47 -05:00
utils [PerfectShuffle] Remove unused variables from D123386. NFC 2022-04-19 16:22:04 +01:00
.clang-format
.clang-tidy
.gitattributes
.gitignore
CMakeLists.txt [cmake] Remove LLVM_ENABLE_NEW_PASS_MANAGER cmake option 2022-04-06 09:52:21 +02:00
CODE_OWNERS.TXT
CREDITS.TXT
LICENSE.TXT
README.txt
RELEASE_TESTERS.TXT
configure
llvm.spec.in

README.txt

The LLVM Compiler Infrastructure
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.