llvm-project/llvm/lib/Transforms/InstCombine
Sanjay Patel 538a8f0227 [InstCombine] convert bitcast-shuffle to vector trunc
As discussed in D76983, that patch can turn a chain of insert/extract
with scalar trunc ops into bitcast+extract and existing instcombine
vector transforms end up creating a shuffle out of that (see the
PhaseOrdering test for an example). Currently, that process requires
at least this sequence: -instcombine -early-cse -instcombine.

Before D76983, the sequence of insert/extract would reach the SLP
vectorizer and become a vector trunc there.

Based on a small sampling of public targets/types, converting the
shuffle to a trunc is better for codegen in most cases (and a
regression of that form is the reason this was noticed). The trunc is
clearly better for IR-level analysis as well.

This means that we can induce "spontaneous vectorization" without
invoking any explicit vectorizer passes (at least a vector cast op
may be created out of scalar casts), but that seems to be the right
choice given that we started with a chain of insert/extract, and the
backend would expand back to that chain if a target does not support
the op.

Differential Revision: https://reviews.llvm.org/D77299
2020-04-05 09:48:02 -04:00
..
CMakeLists.txt [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
InstCombineAddSub.cpp [instcombine] remove fsub to fneg hacks; only emit fneg 2020-03-10 16:57:02 +01:00
InstCombineAndOrXor.cpp [InstCombine] Fix worklist management in foldXorOfICmps() 2020-03-28 18:25:21 +01:00
InstCombineAtomicRMW.cpp [InstCombine] Use replaceOperand() in more places 2020-02-11 17:38:23 +01:00
InstCombineCalls.cpp InstCombine: Reduce minnum/maxnum if inputs are casted 2020-04-03 11:57:25 -04:00
InstCombineCasts.cpp Remove "mask" operand from shufflevector. 2020-03-31 13:08:59 -07:00
InstCombineCompares.cpp [InstCombine] add tests for cmyk benchmark; NFC 2020-04-02 13:00:46 -04:00
InstCombineInternal.h [InstCombine] Don't limit uses in eraseInstFromFunction() 2020-04-04 18:37:30 +02:00
InstCombineLoadStoreAlloca.cpp [InstCombine][SVE] Fix InstCombiner::visitAllocaInst for scalable vector. 2020-03-18 20:57:14 -07:00
InstCombineMulDivRem.cpp [InstCombine] Use replaceOperand() in div transforms 2020-04-01 19:55:00 +02:00
InstCombinePHI.cpp [InstCombine] Use replaceOperand() in non zero phi transform 2020-03-31 21:54:21 +02:00
InstCombineSelect.cpp [InstCombine] Use replaceOperand() in some select transforms 2020-03-31 22:10:55 +02:00
InstCombineShifts.cpp [SVE] Update API ConstantVector::getSplat() to use ElementCount. 2020-03-12 13:22:41 -07:00
InstCombineSimplifyDemanded.cpp Remove "mask" operand from shufflevector. 2020-03-31 13:08:59 -07:00
InstCombineTables.td
InstCombineVectorOps.cpp [InstCombine] convert bitcast-shuffle to vector trunc 2020-04-05 09:48:02 -04:00
InstructionCombining.cpp [InstCombine] enhance freelyNegateValue() by handling 'not' 2020-04-05 09:16:19 -04:00
LLVMBuild.txt Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00