1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00
llvm-mirror/lib
Sanjay Patel c4d2690b90 [DAGCombiner] allow transforming (select Cond, C +/- 1, C) to (add(ext Cond), C)
select Cond, C +/- 1, C --> add(ext Cond), C -- with a target hook.

This is part of the ongoing process to obsolete D24480.  The motivation is to 
canonicalize to select IR in InstCombine whenever possible, so we need to have a way to
undo that easily in codegen.
 
PowerPC is an obvious winner for this kind of transform because it has fast and complete 
bit-twiddling abilities but generally lousy conditional execution perf (although this might
have changed in recent implementations).

x86 also sees some wins, but the effect is limited because these transforms already mostly
exist in its target-specific combineSelectOfTwoConstants(). The fact that we see any x86 
changes just shows that that code is a mess of special-case holes. We may be able to remove 
some of that logic now.

My guess is that other targets will want to enable this hook for most cases. The likely 
follow-ups would be to add value type and/or the constants themselves as parameters for the
hook. As the tests in select_const.ll show, we can transform any select-of-constants to 
math/logic, but the general transform for any 2 constants needs one more instruction 
(multiply or 'and').

ARM is one target that I think may not want this for most cases. I see infinite loops there
because it wants to use selects to enable conditionally executed instructions.

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

llvm-svn: 296977
2017-03-04 19:18:09 +00:00
..
Analysis [SLP] Fixes the bug due to absence of in order uses of scalars which needs to be available 2017-03-03 10:02:47 +00:00
AsmParser
Bitcode
CodeGen [DAGCombiner] allow transforming (select Cond, C +/- 1, C) to (add(ext Cond), C) 2017-03-04 19:18:09 +00:00
DebugInfo [Support] Move Stream library from MSF -> Support. 2017-03-02 20:52:51 +00:00
Demangle
ExecutionEngine [Orc] Rename ObjectLinkingLayer -> RTDyldObjectLinkingLayer. 2017-02-20 05:45:14 +00:00
Fuzzer un-Xfail Fuzzer test that decided to pass on Green Dragon 2017-03-03 21:28:05 +00:00
IR Keep attributes, calling convention, etc, when remangling intrinsic 2017-03-01 01:49:13 +00:00
IRReader
LibDriver
LineEditor
Linker
LTO LTO: Hash the set of imported symbols for each module. 2017-03-03 20:25:30 +00:00
MC MC: De-duplicate the object streamer implementations of EmitFileDirective into MCObjectStreamer. NFCI. 2017-03-03 21:22:06 +00:00
Object Actually add error handling to unpacking the dyld compact bind and 2017-02-28 21:47:07 +00:00
ObjectYAML [ObjectYAML] [DWARF] Abstract DWARF Initial Length values 2017-03-03 21:11:55 +00:00
Option
Passes Add call branch annotation for ICP promoted direct call in SamplePGO mode. 2017-02-23 22:15:18 +00:00
ProfileData [PGO] Text format profile reader needs to clear the value profile 2017-03-03 21:56:34 +00:00
Support Try to fix thread name truncation on non-Windows. 2017-03-04 18:53:09 +00:00
TableGen
Target [DAGCombiner] allow transforming (select Cond, C +/- 1, C) to (add(ext Cond), C) 2017-03-04 19:18:09 +00:00
Transforms Set option enabling LSR alternative way to resolve complex solution to false. 2017-03-04 03:14:05 +00:00
XRay
CMakeLists.txt
LLVMBuild.txt