1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00
Go to file
Cong Hou 20b64d0452 Allow X86::COND_NE_OR_P and X86::COND_NP_OR_E to be reversed.
Currently, AnalyzeBranch() fails non-equality comparison between floating points
on X86 (see https://llvm.org/bugs/show_bug.cgi?id=23875). This is because this
function can modify the branch by reversing the conditional jump and removing
unconditional jump if there is a proper fall-through. However, in the case of
non-equality comparison between floating points, this can turn the branch
"unanalyzable". Consider the following case:

jne.BB1
jp.BB1
jmp.BB2
.BB1:
...
.BB2:
...

AnalyzeBranch() will reverse "jp .BB1" to "jnp .BB2" and then "jmp .BB2" will be
removed:

jne.BB1
jnp.BB2
.BB1:
...
.BB2:
...

However, AnalyzeBranch() cannot analyze this branch anymore as there are two
conditional jumps with different targets. This may disable some optimizations
like block-placement: in this case the fall-through behavior is enforced even if
the fall-through block is very cold, which is suboptimal.

Actually this optimization is also done in block-placement pass, which means we
can remove this optimization from AnalyzeBranch(). However, currently
X86::COND_NE_OR_P and X86::COND_NP_OR_E are not reversible: there is no defined
negation conditions for them.

In order to reverse them, this patch defines two new CondCode X86::COND_E_AND_NP
and X86::COND_P_AND_NE. It also defines how to synthesize instructions for them.
Here only the second conditional jump is reversed. This is valid as we only need
them to do this "unconditional jump removal" optimization.


Differential Revision: http://reviews.llvm.org/D11393

llvm-svn: 258847
2016-01-26 20:08:01 +00:00
autoconf
bindings
cmake Reapplying r256836 with a fix for MSVC 14 support. 2016-01-25 14:17:39 +00:00
docs [llvm-readobj] Add -elf-section-groups option 2016-01-26 19:46:39 +00:00
examples
include Fix Clang-tidy modernize-use-nullptr and modernize-use-override warnings; other minor fixes. 2016-01-26 18:48:36 +00:00
lib Allow X86::COND_NE_OR_P and X86::COND_NP_OR_E to be reversed. 2016-01-26 20:08:01 +00:00
projects
resources
test Allow X86::COND_NE_OR_P and X86::COND_NP_OR_E to be reversed. 2016-01-26 20:08:01 +00:00
tools [llvm-nm] Roll several conditions into a single if. NFCI. 2016-01-26 19:57:42 +00:00
unittests Fix Clang-tidy modernize-use-nullptr and modernize-use-override warnings; other minor fixes. 2016-01-26 18:48:36 +00:00
utils Fix Clang-tidy modernize-use-nullptr and modernize-use-override warnings; other minor fixes. 2016-01-26 18:48:36 +00:00
.arcconfig
.clang-format
.clang-tidy
.gitignore
CMakeLists.txt
CODE_OWNERS.TXT
configure
CREDITS.TXT
LICENSE.TXT
llvm.spec.in
LLVMBuild.txt
Makefile
Makefile.common
Makefile.config.in
Makefile.rules
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.