1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00
Go to file
Kristof Beyls 1b3bd06827 [SLH] AArch64: correctly pick temporary register to mask SP
As part of speculation hardening, the stack pointer gets masked with the
taint register (X16) before a function call or before a function return.
Since there are no instructions that can directly mask writing to the
stack pointer, the stack pointer must first be transferred to another
register, where it can be masked, before that value is transferred back
to the stack pointer.
Before, that temporary register was always picked to be x17, since the
ABI allows clobbering x17 on any function call, resulting in the
following instruction pattern being inserted before function calls and
returns/tail calls:

mov x17, sp
and x17, x17, x16
mov sp, x17
However, x17 can be live in those locations, for example when the call
is an indirect call, using x17 as the target address (blr x17).

To fix this, this patch looks for an available register just before the
call or terminator instruction and uses that.

In the rare case when no register turns out to be available (this
situation is only encountered twice across the whole test-suite), just
insert a full speculation barrier at the start of the basic block where
this occurs.

Differential Revision: https://reviews.llvm.org/D56717

llvm-svn: 351930
2019-01-23 08:18:39 +00:00
benchmarks
bindings Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
cmake Fix llvm::is_trivially_copyable portability issues 2019-01-22 13:48:55 +00:00
docs [Docs] Add a note clarifying how to get good test performances. 2019-01-22 21:52:50 +00:00
examples Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
include [Pipeliner] Add two pragmas to control software pipelining optimization 2019-01-23 03:26:10 +00:00
lib [SLH] AArch64: correctly pick temporary register to mask SP 2019-01-23 08:18:39 +00:00
projects Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
resources
runtimes
test [SLH] AArch64: correctly pick temporary register to mask SP 2019-01-23 08:18:39 +00:00
tools [llvm-objcopy] Return Error from Buffer::allocate(), [ELF]Writer::finalize(), and [ELF]Writer::commit() 2019-01-22 23:49:16 +00:00
unittests GlobalISel: Make buildConstant handle vectors 2019-01-22 21:31:02 +00:00
utils gn build: Merge r351820. 2019-01-23 02:19:56 +00:00
.arcconfig
.clang-format
.clang-tidy
.gitattributes
.gitignore Git ignore CLion project configuration files. NFC 2019-01-02 19:58:07 +00:00
CMakeLists.txt Revert r351324 "Build LLVM-C.dll by default on windows and enable in release package" 2019-01-16 12:36:28 +00:00
CODE_OWNERS.TXT [llvm-mca] Move llvm-mca library to llvm/lib/MCA. 2018-12-17 08:08:31 +00:00
configure
CREDITS.TXT Remove a period from CREDITS.TXT (testing email change). NFC 2019-01-19 09:07:38 +00:00
LICENSE.TXT Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
llvm.spec.in Update structured references to the license to the new license. 2019-01-19 11:30:51 +00:00
LLVMBuild.txt Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
README.txt
RELEASE_TESTERS.TXT Update the list of platforms & archs 2018-12-16 14:47:16 +00:00

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.