llvm-project/llvm/test
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 [SCEV] Make computeExitLimit more simple and more powerful 2018-04-03 05:57:19 +00:00
Assembler Make the LLParser accept call instructions of variables in the program AS 2018-02-27 11:15:11 +00:00
Bindings Add C API bindings for DIBuilder 'Type' APIs 2018-04-02 00:17:40 +00:00
Bitcode Refactor check for dllimport in the Verifier. 2018-03-06 17:19:23 +00:00
BugPoint
CodeGen [Hexagon] Remove unneeded attributes from lit test 2018-04-03 16:05:20 +00:00
DebugInfo [MSF] Default to FPM2, and always mark FPM pages allocated. 2018-03-29 18:34:15 +00:00
Examples
ExecutionEngine [RuntimeDyld][MachO] Fix assertion in encodeAddend, add missing directive to 2018-03-01 01:44:33 +00:00
Feature Remove the LoopInstSimplify pass (-loop-instsimplify) 2018-03-12 20:49:42 +00:00
FileCheck
Instrumentation MSan: introduce the conservative assembly handling mode. 2018-04-03 09:50:06 +00:00
Integer
JitListener
LTO Object: Fix handling of @@@ in .symver directive 2018-03-20 00:45:03 +00:00
Linker [DebugInfo] Add remaining files to r325970 2018-02-23 23:13:18 +00:00
MC Remove llvm-mcmarkup. 2018-04-02 23:17:55 +00:00
Object [llvm-ar] Support multiple dashed options 2018-03-28 17:21:14 +00:00
ObjectYAML [WebAssembly] Disallow weak undefined globals in the object format 2018-03-09 16:30:44 +00:00
Other [PM][FunctionAttrs] add NoUnwind attribute inference to PostOrderFunctionAttrs pass 2018-03-23 21:46:16 +00:00
SafepointIRVerifier
SymbolRewriter
TableGen TableGen: Support Intrinsic values in SearchableTable 2018-04-01 17:08:58 +00:00
ThinLTO/X86 [ThinLTO] Clear dllimport when setting dso_local. 2018-03-13 15:24:51 +00:00
Transforms [InstCombine] Fold compare of int constant against a splatted vector of ints 2018-04-03 17:26:20 +00:00
Unit
Verifier [DebugInfo] Add verifier for DICompositeType vector 2018-03-08 19:31:37 +00:00
YAMLParser
tools [llvm-mca] Move the logic that prints register file statistics to its own view. NFCI 2018-04-03 16:46:23 +00:00
.clang-format
CMakeLists.txt Remove llvm-mcmarkup. 2018-04-02 23:17:55 +00:00
TestRunner.sh
lit.cfg.py Remove llvm-mcmarkup. 2018-04-02 23:17:55 +00:00
lit.site.cfg.py.in