llvm-project/llvm/lib
Craig Topper f94ed26ea9 [X86] Directly legalize v16i16/v8i16 vselect to vXi8 vselect to use VPBLENDVB
The intrinsic legalization for masked truncate uses ISD::TRUNCATE which can be constant folded by getNode. This prevents getVectorMaskingNode from seeing the ISD::TRUNCATE special case where it should emit X86ISD::SELECT instead of ISD::VSELECT. This causes a vselect with a v16i1 or v8i1 condition to be emitted during vector legalization. but vector legalization doesn't revisit nodes it creates. DAG combine will then promote this condition to match the result type. Then op legalization will try to legalize it, but the custom lowering hook returned SDValue(). But op legalization doesn't have an Expand for VSELECT because it expects vector legalization to have taken care of it. So the operation sticks around and fails in isel.

This patch adds a custom legalization hook to morph it to a vXi8 vselect instead.

This also simplifies the normal vXi16 vselect handling because vector legalization was normally expanding to AND/ANDN/OR and DAG combine was turning that into VBLENDVB. So we can skip a step by doing it directly.

Fixes PR37499

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

llvm-svn: 332743
2018-05-18 17:48:06 +00:00
..
Analysis Add remarks describing when a pass changes the IR instruction count of a module 2018-05-18 17:26:39 +00:00
AsmParser [STLExtras] Add distance() for ranges, pred_size(), and succ_size() 2018-05-10 23:01:54 +00:00
BinaryFormat [WebAssembly] Move toString helpers to BinaryFormat 2018-05-14 22:42:07 +00:00
Bitcode [STLExtras] Add distance() for ranges, pred_size(), and succ_size() 2018-05-10 23:01:54 +00:00
CodeGen Revert changes from D46265. 2018-05-18 17:47:10 +00:00
DebugInfo Resubmit [pdb] Change /DEBUG:GHASH to emit 8 byte hashes." 2018-05-17 22:55:15 +00:00
Demangle [demangler] Add a partial demangling API for LLDB. 2018-04-12 20:41:38 +00:00
ExecutionEngine [ORC] Consolidate materialization errors, and generate them in VSO's 2018-05-17 20:48:58 +00:00
FuzzMutate [llvm-opt-fuzzer] Add irce to the fuzzing options 2018-03-20 11:32:13 +00:00
Fuzzer
IR Add remarks describing when a pass changes the IR instruction count of a module 2018-05-18 17:26:39 +00:00
IRReader LLParser: add an argument for overriding data layout and do not check alloca addr space 2018-01-30 22:32:39 +00:00
LTO Rename DEBUG macro to LLVM_DEBUG. 2018-05-14 12:53:11 +00:00
LineEditor
Linker [ThinLTO] Recommit of import global variables 2018-03-12 10:30:50 +00:00
MC [MC] Relax .fill size requirements 2018-05-18 17:45:48 +00:00
Object [NFC] WebAssembly build break #2 2018-05-16 22:31:42 +00:00
ObjectYAML Resubmit [pdb] Change /DEBUG:GHASH to emit 8 byte hashes." 2018-05-17 22:55:15 +00:00
Option Revert "[Option] Fix PR37006 prefix choice in findNearest" 2018-05-14 22:36:47 +00:00
Passes Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
ProfileData Rename DEBUG macro to LLVM_DEBUG. 2018-05-14 12:53:11 +00:00
Support [X86][CET] Changing -fcf-protection behavior to comply with gcc (LLVM part) 2018-05-18 11:58:25 +00:00
TableGen Revert r330742: Let TableGen write output only if it changed, instead of doing so in cmake. 2018-05-07 23:41:48 +00:00
Target [X86] Directly legalize v16i16/v8i16 vselect to vXi8 vselect to use VPBLENDVB 2018-05-18 17:48:06 +00:00
Testing [LLVMTestingSupport] Add explicit linkage to LLVMSupport 2018-04-08 06:49:17 +00:00
ToolDrivers [COFF] Improve correctness of def parsing for GNU features 2018-05-09 09:21:53 +00:00
Transforms [SimplifyCFG] Fix a debug invariant bug in FoldBranchToCommonDest() 2018-05-18 08:52:15 +00:00
WindowsManifest Convert line endings of lib/WindowsManifest/CMakeLists.txt to unix. 2018-04-07 04:28:08 +00:00
XRay [XRay] clarify error messages when parsing broken traces 2018-01-30 13:41:34 +00:00
CMakeLists.txt
LLVMBuild.txt