hanchenye-llvm-project/llvm
Eli Friedman 638be660d7 [ARM] Eliminate redundant "mov rN, sp" instructions in Thumb1.
This takes sequences like "mov r4, sp; str r0, [r4]", and optimizes them
to something like "str r0, [sp]".

For regular stack variables, this optimization was already implemented:
we lower loads and stores using frame indexes, which are expanded later.
However, when constructing a call frame for a call with more than four
arguments, the existing optimization doesn't apply.  We need to use
stores which are actually relative to the current value of sp, and don't
have an associated frame index.

This patch adds a special case to handle that construct.  At the DAG
level, this is an ISD::STORE where the address is a CopyFromReg from SP
(plus a small constant offset).

This applies only to Thumb1: in Thumb2 or ARM mode, a regular store
instruction can access SP directly, so the COPY gets eliminated by
existing code.

The change to ARMDAGToDAGISel::SelectThumbAddrModeSP is a related
cleanup: we shouldn't pretend that it can select anything other than
frame indexes.

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

llvm-svn: 356601
2019-03-20 19:40:45 +00:00
..
benchmarks
bindings [bindings/go] Fix building on 32-bit systems (ARM etc.) 2019-02-16 22:33:10 +00:00
cmake Remove HAVE_REALPATH from config.h 2019-03-20 17:26:11 +00:00
docs [DebugInfo] Introduce DW_OP_LLVM_convert 2019-03-19 13:16:28 +00:00
examples [Kaleidoscope] Fix symbol resolver to search in reverse order. 2019-02-21 16:53:04 +00:00
include [AMDGPU] Added MsgPack format PAL metadata 2019-03-20 18:47:21 +00:00
lib [ARM] Eliminate redundant "mov rN, sp" instructions in Thumb1. 2019-03-20 19:40:45 +00:00
projects
resources
runtimes [runtime] Use --strip-all rather than --strip-sections 2019-03-10 04:26:54 +00:00
test [ARM] Eliminate redundant "mov rN, sp" instructions in Thumb1. 2019-03-20 19:40:45 +00:00
tools [AMDGPU] Factored PAL metadata handling out into its own class 2019-03-20 17:42:00 +00:00
unittests Reland "[Remarks] Add a new Remark / RemarkParser abstraction" 2019-03-19 21:11:07 +00:00
utils Remove HAVE_REALPATH from config.h 2019-03-20 17:26:11 +00:00
.arcconfig
.clang-format
.clang-tidy
.gitattributes
.gitignore [clangd] Store index in '.clangd/index' instead of '.clangd-index' 2019-02-20 19:08:06 +00:00
CMakeLists.txt Use response file when generating LLVM-C.dll 2019-03-19 09:14:09 +00:00
CODE_OWNERS.TXT
CREDITS.TXT [NFC] Add to contributor list. 2019-02-26 05:46:45 +00:00
LICENSE.TXT
LLVMBuild.txt
README.txt Testing commit access 2019-02-19 20:38:51 +00:00
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.