1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
llvm-mirror/test
Sanjay Patel 43a91b22c0 [x86] transform vector inc/dec to use -1 constant (PR33483)
Convert vector increment or decrement to sub/add with an all-ones constant:

add X, <1, 1...> --> sub X, <-1, -1...>
sub X, <1, 1...> --> add X, <-1, -1...>

The all-ones vector constant can be materialized using a pcmpeq instruction that is 
commonly recognized as an idiom (has no register dependency), so that's better than 
loading a splat 1 constant.

AVX512 uses 'vpternlogd' for 512-bit vectors because there is apparently no better
way to produce 512 one-bits.

The general advantages of this lowering are:
1. pcmpeq has lower latency than a memop on every uarch I looked at in Agner's tables, 
   so in theory, this could be better for perf, but...

2. That seems unlikely to affect any OOO implementation, and I can't measure any real 
   perf difference from this transform on Haswell or Jaguar, but...

3. It doesn't look like it from the diffs, but this is an overall size win because we 
   eliminate 16 - 64 constant bytes in the case of a vector load. If we're broadcasting 
   a scalar load (which might itself be a bug), then we're replacing a scalar constant 
   load + broadcast with a single cheap op, so that should always be smaller/better too.

4. This makes the DAG/isel output more consistent - we use pcmpeq already for padd x, -1 
   and psub x, -1, so we should use that form for +1 too because we can. If there's some
   reason to favor a constant load on some CPU, let's make the reverse transform for all
   of these cases (either here in the DAG or in a later machine pass).

This should fix:
https://bugs.llvm.org/show_bug.cgi?id=33483

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

llvm-svn: 306289
2017-06-26 14:19:26 +00:00
..
Analysis [AVX2] [TTI CostModel] Add cost of interleaved loads/stores for AVX2 2017-06-25 08:26:25 +00:00
Assembler Align definition of DW_OP_plus with DWARF spec [3/3] 2017-06-14 13:14:38 +00:00
Bindings [LLVM-C] [OCaml] Expose Type::subtypes. 2017-06-05 11:49:52 +00:00
Bitcode Align definition of DW_OP_plus with DWARF spec [3/3] 2017-06-14 13:14:38 +00:00
BugPoint bugpoint: disabling symbolication of bugpoint-executed programs 2017-06-09 07:29:03 +00:00
CodeGen [x86] transform vector inc/dec to use -1 constant (PR33483) 2017-06-26 14:19:26 +00:00
DebugInfo [llvm-pdbutil] Dump raw bytes of module symbols and debug chunks. 2017-06-23 23:08:57 +00:00
Examples
ExecutionEngine
Feature
FileCheck [FileCheck] Don't scan past the closing CHECK-DAG for CHECK-NOT inside CHECK-DAG 2017-06-07 12:06:45 +00:00
Instrumentation Fixing section name for Darwin platforms for sanitizer coverage 2017-06-14 23:40:25 +00:00
Integer
JitListener
LibDriver [llvm-ar] Make llvm-lib behave more like the MSVC archiver 2017-06-12 19:45:35 +00:00
Linker [Linker] Remove llc usage from link-arm-and-thumb.ll test case. 2017-06-07 09:59:22 +00:00
LTO Apply summary-based dead stripping to regular LTO modules with summaries. 2017-06-15 17:26:13 +00:00
MC fix trivial typo in comment, NFC 2017-06-26 06:32:04 +00:00
Object obj2yaml: Improve error reporting 2017-06-16 23:29:54 +00:00
ObjectYAML [WebAssembly] Add support for weak symbols in the binary format 2017-06-20 04:04:59 +00:00
Other [PM/ThinLTO] Port the ThinLTO pipeline (both components) to the new PM. 2017-06-01 11:39:39 +00:00
SymbolRewriter
TableGen [globalisel][tablegen] Add support for COPY_TO_REGCLASS. 2017-06-20 12:36:34 +00:00
ThinLTO/X86 [cfi] CFI-ICall for ThinLTO. 2017-06-16 00:18:29 +00:00
tools [llvm-readobj] Fix COFF RVA table dumping bug 2017-06-23 22:12:11 +00:00
Transforms [X86][LLVM][test]Expanding Supports lowerInterleavedStore() in X86InterleavedAccess test. 2017-06-26 13:27:32 +00:00
Unit
Verifier [Atomics] Rename and change prototype for atomic memcpy intrinsic 2017-06-16 14:43:59 +00:00
YAMLParser
.clang-format
CMakeLists.txt Rename llvm-pdbdump -> llvm-pdbutil. 2017-06-09 20:46:17 +00:00
lit.cfg [llvm-pdbdump] Don't fail on PDBs with no ID stream. 2017-06-12 21:34:53 +00:00
lit.site.cfg.in Introduce the new feature "abi-breaking-checks" to satisfy -reverse-iterate in llvm/test/Transforms/Util/PredicateInfo/ 2017-06-07 00:22:52 +00:00
TestRunner.sh