1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
llvm-mirror/test/CodeGen
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
..
AArch64 [MC] Use .p2align instead of .align 2016-01-26 00:03:25 +00:00
AMDGPU AMDGPU: Make v32i8/v64i8 illegal types 2016-01-26 04:43:48 +00:00
ARM [MC] Use .p2align instead of .align 2016-01-26 00:03:25 +00:00
BPF
CPP
Generic Unxfail passing testcase on Hexagon 2016-01-14 15:24:15 +00:00
Hexagon [Hexagon] Use general purpose registers to spill pred/mod registers into 2016-01-22 19:15:58 +00:00
Inputs
Mips [MC] Use .p2align instead of .align 2016-01-26 00:03:25 +00:00
MIR Reapply r257105 "[Verifier] Check that debug values have proper size" 2016-01-15 00:46:17 +00:00
MSP430
NVPTX [CUDA] Die gracefully when trying to output an LLVM alias. 2016-01-23 21:12:20 +00:00
PowerPC [MC] Use .p2align instead of .align 2016-01-26 00:03:25 +00:00
SPARC [SPARC] Revamp AnalyzeBranch and add ReverseBranchCondition. 2016-01-13 04:44:14 +00:00
SystemZ [SystemZ] Fix assertion failure in adjustSubwordCmp 2015-12-16 18:04:06 +00:00
Thumb [MC] Use .p2align instead of .align 2016-01-26 00:03:25 +00:00
Thumb2 [MC] Use .p2align instead of .align 2016-01-26 00:03:25 +00:00
WebAssembly [WebAssembly] Optimize memcpy/memmove/memcpy calls. 2016-01-26 04:01:11 +00:00
WinEH [WinEH] Don't miscompile cleanups which conditionally unwind to caller 2016-01-23 23:54:33 +00:00
X86 Allow X86::COND_NE_OR_P and X86::COND_NP_OR_E to be reversed. 2016-01-26 20:08:01 +00:00
XCore [MC] Use .p2align instead of .align 2016-01-26 00:03:25 +00:00