llvm-project/llvm
Koakuma 1466d65d9b [SPARC] Don't do leaf optimization on procedures with inline assembly
On SPARC, leaf function optimization omits the register window sliding (and the associated register name changes). This might result in miscompilation of procedures containing inline assembly, as some of the register constraints used may interfere with the register usage of optimized functions, so we disable leaf procedure optimization on those procedures to prevent it from happening.

This is a continuation of patch D102342 by @LemonBoy, the original comment is reproduced below:

> Leaf functions allow the compiler to omit the setup and teardown of a frame pointer, therefore avoiding the exchange of the in/out register. According to the SPARC architecture manual every reference to %i0-%i5 should be replaced with %o0-o5, if the target register is already in use a further remapping step to %g1-%g7 is required to free the output register.
>
> Add a simple check to make sure not to stomp on any output register that's already in use.

Reviewed By: dcederman

Differential Revision: https://reviews.llvm.org/D128263
2022-06-27 15:09:30 +02:00
..
benchmarks
bindings [ArgPromotion] Remove legacy PM support 2022-06-27 09:42:17 +02:00
cmake [CMake] Don't pass CMAKE_C(XX)_COMPILER to the nested NATIVE build when cross compiling 2022-06-22 09:33:50 +03:00
docs [AMDGPU][GFX9][DOC][NFC] Update assembler syntax description 2022-06-27 14:03:58 +03:00
examples Remove unneeded cl::ZeroOrMore for cl::opt/cl::list options 2022-06-05 01:07:51 -07:00
include [IR] Move vector.insert/vector.extract out of experimental namespace 2022-06-27 10:48:45 +00:00
lib [SPARC] Don't do leaf optimization on procedures with inline assembly 2022-06-27 15:09:30 +02:00
projects
resources
runtimes
test [SPARC] Don't do leaf optimization on procedures with inline assembly 2022-06-27 15:09:30 +02:00
tools [llvm-ar] Improve MRI script CREATE command handling 2022-06-27 11:11:16 +01:00
unittests [llvm] Don't use Optional::hasValue (NFC) 2022-06-25 21:42:52 -07:00
utils [gn build] Port 633d1d0df7 2022-06-27 12:35:34 +00:00
.clang-format
.clang-tidy
.gitattributes
.gitignore
CMakeLists.txt [Clang][C++23] P2071 Named universal character escapes 2022-06-25 19:03:33 +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.