hanchenye-llvm-project/llvm
Alex Bradbury 5518cbfc41 Teach TargetInstrInfo::getInlineAsmLength to parse .space directives with integer arguments
It's currently quite difficult to test passes like branch relaxation, which
requires branches with large displacement to be generated. The .space assembler
directive makes it easy to create arbitrarily large basic blocks, but
getInlineAsmLength is not able to parse it and so the size of the block is not
correctly estimated. Other backends (AArch64, AMDGPU) introduce options just
for testing that artificially restrict the ranges of branch instructions (e.g.
aarch64-tbz-offset-bits). Although parsing a single form of the .space
directive feels inelegant, it does allow a more direct testing approach.

This patch adapts the .space parsing code from
Mips16InstrInfo::getInlineAsmLength and removes it now the extra functionality
is provided by the base implementation. I want to move this functionality to
the generic getInlineAsmLength as 1) I need the same for RISC-V, and 2) I feel
other backends will benefit from more direct testing of large branch
displacements.

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

llvm-svn: 314393
2017-09-28 09:31:46 +00:00
..
bindings
cmake Cleanup some problems with LLVM_ENABLE_DUMP in release builds, and 2017-09-27 21:19:56 +00:00
docs [docs] llvm-cov: Make docs for boolean options more consistent 2017-09-25 23:10:04 +00:00
examples Fix broken links to the Itanium CXX ABI 2017-09-12 00:19:11 +00:00
include [RISCV] Define RISC-V specific e_flags 2017-09-28 07:54:01 +00:00
lib Teach TargetInstrInfo::getInlineAsmLength to parse .space directives with integer arguments 2017-09-28 09:31:46 +00:00
projects
resources
runtimes [CMake][runtimes] Use the same configuration for non-target and "default" target 2017-09-08 22:26:50 +00:00
test [PowerPC] eliminate partially redundant compare instruction 2017-09-28 08:38:19 +00:00
tools Update the description of AVR32 for the ELFDumper 2017-09-27 22:39:37 +00:00
unittests Use a BumpPtrAllocator for Loop objects 2017-09-28 02:45:42 +00:00
utils Cleanup some problems with LLVM_ENABLE_DUMP in release builds, and 2017-09-27 21:19:56 +00:00
.arcconfig
.clang-format
.clang-tidy
.gitignore
CMakeLists.txt [CMake] Fix typo: "in-tree" -> "in-source" (NFC) 2017-09-27 21:37:33 +00:00
CODE_OWNERS.TXT [ARC] Add ARC backend. 2017-08-24 15:40:33 +00:00
CREDITS.TXT Add myself to CREDITS.txt 2017-09-18 14:33:39 +00:00
LICENSE.TXT
LLVMBuild.txt
README.txt Test commit access 2017-08-18 02:39:28 +00:00
RELEASE_TESTERS.TXT
configure
llvm.spec.in

README.txt

Low Level Virtual Machine (LLVM)
================================

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.