llvm-project/llvm/lib
Daniel Neilson 901acfab0c [InstCombine] Fold compare of int constant against a splatted vector of ints
Summary:
Folding patterns like:
  %vec = shufflevector <4 x i8> %insvec, <4 x i8> undef, <4 x i32> zeroinitializer
  %cast = bitcast <4 x i8> %vec to i32
  %cond = icmp eq i32 %cast, 0
into:
  %ext = extractelement <4 x i8> %insvec, i32 0
  %cond = icmp eq i32 %ext, 0

Combined with existing rules, this allows us to fold patterns like:
  %insvec = insertelement <4 x i8> undef, i8 %val, i32 0
  %vec = shufflevector <4 x i8> %insvec, <4 x i8> undef, <4 x i32> zeroinitializer
  %cast = bitcast <4 x i8> %vec to i32
  %cond = icmp eq i32 %cast, 0
into:
  %cond = icmp eq i8 %val, 0

When we construct a splat vector via a shuffle, and bitcast the vector into an integer type for comparison against an integer constant. Then we can simplify the the comparison to compare the splatted value against the integer constant.

Reviewers: spatel, anna, mkazantsev

Reviewed By: spatel

Subscribers: efriedma, rengolin, llvm-commits

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

llvm-svn: 329087
2018-04-03 17:26:20 +00:00
..
Analysis [SLP] Fix PR36481: vectorize reassociated instructions. 2018-04-03 17:14:47 +00:00
AsmParser [SimplifyCFG] Create attribute for fuzzing-specific optimizations. 2018-03-22 17:07:51 +00:00
BinaryFormat Fix build broken by r328090 2018-03-21 12:18:03 +00:00
Bitcode [ThinLTO] Add an option to force summary call edges cold for debugging 2018-03-31 00:18:08 +00:00
CodeGen Adding optional Name parameter to createVirtualRegister and createGenericVirtualRegister. 2018-04-03 15:53:49 +00:00
DebugInfo [llvm-pdbutil] Add an export subcommand. 2018-04-02 18:35:21 +00:00
Demangle [demangler] Fix a bug in r328464 found by oss-fuzz. 2018-03-26 15:34:36 +00:00
ExecutionEngine [ORC] Create a new SymbolStringPool by default in ExecutionSession constructor. 2018-04-02 20:57:56 +00:00
FuzzMutate [llvm-opt-fuzzer] Add irce to the fuzzing options 2018-03-20 11:32:13 +00:00
Fuzzer [libFuzzer] Delete llvm/lib/Fuzzer 2017-10-16 20:48:19 +00:00
IR Fix header mismatch in DIBuilder Type APIs 2018-04-02 19:11:44 +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 Prevent data races in concurrent ThinLTO processes. 2018-03-30 21:35:42 +00:00
LineEditor
Linker [ThinLTO] Recommit of import global variables 2018-03-12 10:30:50 +00:00
MC [MC] Fix -Wmissing-field-initializer warning after r329067. 2018-04-03 13:52:26 +00:00
Object [llvm-ar] Support multiple dashed options 2018-03-28 17:21:14 +00:00
ObjectYAML Reland "[DebugInfo] Support DWARF expressions in eh_frame" 2018-03-08 00:46:53 +00:00
Option [NFC] Replace iterators in PrintHelp with range-based for 2018-03-12 18:31:07 +00:00
Passes Fix Layering, move instrumentation transform headers into Instrumentation subdirectory 2018-03-23 22:11:06 +00:00
ProfileData Revert "Revert "[InstrProf] Support for external functions in text format."" 2018-03-22 21:26:52 +00:00
Support Remove HAVE_LIBPSAPI, HAVE_SHELL32. 2018-04-02 17:32:48 +00:00
TableGen TableGen: Remove redundant loop in ListInit::resolveReferences 2018-03-21 17:13:10 +00:00
Target [Hexagon] Remove -mhvx-double and the corresponding subtarget feature 2018-04-03 16:06:36 +00:00
Testing Force #define GTEST_LANG_CXX11. 2017-10-27 21:12:28 +00:00
ToolDrivers [COFF] Keep the underscore on exported decorated stdcall functions in MSVC mode 2018-01-20 11:44:32 +00:00
Transforms [InstCombine] Fold compare of int constant against a splatted vector of ints 2018-04-03 17:26:20 +00:00
WindowsManifest
XRay [XRay] clarify error messages when parsing broken traces 2018-01-30 13:41:34 +00:00
CMakeLists.txt
LLVMBuild.txt