1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
llvm-mirror/lib
Chandler Carruth d8a4e1fee3 [x86] Revert r218588, r218589, and r218600. These patches were pursuing
a flawed direction and causing miscompiles. Read on for details.

Fundamentally, the premise of this patch series was to map
VECTOR_SHUFFLE DAG nodes into VSELECT DAG nodes for all blends because
we are going to *have* to lower to VSELECT nodes for some blends to
trigger the instruction selection patterns of variable blend
instructions. This doesn't actually work out so well.

In order to match performance with the existing VECTOR_SHUFFLE
lowering code, we would need to re-slice the blend in order to fit it
into either the integer or floating point blends available on the ISA.
When coming from VECTOR_SHUFFLE (or other vNi1 style VSELECT sources)
this works well because the X86 backend ensures that these types of
operands to VSELECT get sign extended into '-1' and '0' for true and
false, allowing us to re-slice the bits in whatever granularity without
changing semantics.

However, if the VSELECT condition comes from some other source, for
example code lowering vector comparisons, it will likely only have the
required bit set -- the high bit. We can't blindly slice up this style
of VSELECT. Reid found some code using Halide that triggers this and I'm
hopeful to eventually get a test case, but I don't need it to understand
why this is A Bad Idea.

There is another aspect that makes this approach flawed. When in
VECTOR_SHUFFLE form, we have very distilled information that represents
the *constant* blend mask. Converting back to a VSELECT form actually
can lose this information, and so I think now that it is better to treat
this as VECTOR_SHUFFLE until the very last moment and only use VSELECT
nodes for instruction selection purposes.

My plan is to:
1) Clean up and formalize the target pre-legalization DAG combine that
   converts a VSELECT with a constant condition operand into
   a VECTOR_SHUFFLE.
2) Remove any fancy lowering from VSELECT during *legalization* relying
   entirely on the DAG combine to catch cases where we can match to an
   immediate-controlled blend instruction.

One additional step that I'm not planning on but would be interested in
others' opinions on: we could add an X86ISD::VSELECT or X86ISD::BLENDV
which encodes a fully legalized VSELECT node. Then it would be easy to
write isel patterns only in terms of this to ensure VECTOR_SHUFFLE
legalization only ever forms the fully legalized construct and we can't
cycle between it and VSELECT combining.

llvm-svn: 218658
2014-09-30 02:52:28 +00:00
..
Analysis Ignore annotation function calls in cost computation 2014-09-26 17:48:40 +00:00
AsmParser Make CallingConv::ID an alias of "unsigned". 2014-09-10 18:00:17 +00:00
Bitcode Do not destroy external linkage when deleting function body 2014-09-23 12:54:19 +00:00
CodeGen Add MachineOperand::ChangeToFPImmediate and setFPImm 2014-09-28 19:24:59 +00:00
DebugInfo Store TypeUnits in a SmallVector<DWARFUnitSection> instead of a single DWARFUnitSection. 2014-09-29 13:56:39 +00:00
ExecutionEngine Unit test r218187, changing RTDyldMemoryManager::getSymbolAddress's behavior favor mangled lookup over unmangled lookup. 2014-09-29 21:25:13 +00:00
IR Remove dead code from DIBuilder 2014-09-29 06:32:54 +00:00
IRReader Pass a && to getLazyBitcodeModule. 2014-09-03 17:31:46 +00:00
LineEditor
Linker Merge alignment of common GlobalValue. 2014-09-09 17:48:18 +00:00
LTO LTO: introduce object file-based on-disk module format. 2014-09-18 21:28:49 +00:00
MC WinCOFFObjectWriter: optimize the string table for common suffices 2014-09-29 22:43:20 +00:00
Object Object: BSS/virtual sections don't have contents 2014-09-26 22:32:16 +00:00
Option Add an overload of getLastArgNoClaim taking two OptSpecifiers. 2014-09-12 19:42:53 +00:00
ProfileData llvm-cov: Combine segments that cover the same location 2014-09-25 00:34:18 +00:00
Support Fix llvm::huge_valf multiple initializations with Visual C++. 2014-09-27 14:41:29 +00:00
TableGen Refactoring: raw pointer -> unique_ptr 2014-09-25 19:55:58 +00:00
Target [x86] Revert r218588, r218589, and r218600. These patches were pursuing 2014-09-30 02:52:28 +00:00
Transforms Use a loop to simplify the runtime unrolling prologue. 2014-09-29 11:15:00 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile