llvm-project/llvm/test/Transforms/PhaseOrdering
Sanjay Patel e71b81cab0 [InstCombine] canonicalize trunc + insert as bitcast + shuffle, part 1 (2nd try)
The first attempt was reverted because a clang test changed
unexpectedly - the file is already marked with a FIXME, so
I just updated it this time to pass.

Original commit message:
This is the main patch for converting a truncated scalar that is
inserted into a vector to bitcast+shuffle. We could go either way
on patterns like this, but this direction will allow collapsing a
pair of these sequences on the motivating example from issue

The patch is split into 3 parts to make it easier to see the
progression of tests diffs. We allow inserting/shuffling into a
different size vector for flexibility, so there are several test
variations. The length-changing is handled by shortening/padding
the shuffle mask with undef elements.

In part 1, handle the basic pattern:
inselt undef, (trunc T), IndexC --> shuffle (bitcast T), IdentityMask

Proof for the endian-dependency behaving as expected:
https://alive2.llvm.org/ce/z/BsA7yC

The TODO items for handling shifts and insert into an arbitrary base
vector value are implemented as follow-ups.

Differential Revision: https://reviews.llvm.org/D138872
2022-11-30 14:52:20 -05:00
..
AArch64 PhaseOrdering: Convert tests to opaque pointers 2022-11-27 21:26:41 -05:00
ARM PhaseOrdering: Convert tests to opaque pointers 2022-11-27 21:26:41 -05:00
SystemZ [PhaseOrdering] add explanatory comment for test; NFC 2022-07-24 17:07:17 -04:00
X86 [InstCombine] canonicalize trunc + insert as bitcast + shuffle, part 1 (2nd try) 2022-11-30 14:52:20 -05:00
2010-03-22-empty-baseclass.ll PhaseOrdering: Convert tests to opaque pointers 2022-11-27 21:26:41 -05:00
PR6627.ll PhaseOrdering: Convert tests to opaque pointers 2022-11-27 21:26:41 -05:00
assume-explosion.ll PhaseOrdering: Convert tests to opaque pointers 2022-11-27 21:26:41 -05:00
basic.ll PhaseOrdering: Convert tests to opaque pointers 2022-11-27 21:26:41 -05:00
bitfield-bittests.ll
cmp-logic.ll PhaseOrdering: Convert tests to opaque pointers 2022-11-27 21:26:41 -05:00
d83507-knowledge-retention-bug.ll PhaseOrdering: Convert tests to opaque pointers 2022-11-27 21:26:41 -05:00
dce-after-argument-promotion.ll PhaseOrdering: Convert tests to opaque pointers 2022-11-27 21:26:41 -05:00
deletion-of-loops-that-became-side-effect-free.ll PhaseOrdering: Convert tests to opaque pointers 2022-11-27 21:26:41 -05:00
expect.ll PhaseOrdering: Convert tests to opaque pointers 2022-11-27 21:26:41 -05:00
fast-basictest.ll [PhaseOrdering] Add missing x86 registered target requirement to fast-basictest.ll 2022-09-27 20:59:57 +01:00
fast-reassociate-gvn.ll PhaseOrdering: Convert tests to opaque pointers 2022-11-27 21:26:41 -05:00
gdce.ll PhaseOrdering: Convert tests to opaque pointers 2022-11-27 21:26:41 -05:00
globalaa-retained.ll PhaseOrdering: Convert tests to opaque pointers 2022-11-27 21:26:41 -05:00
inlining-alignment-assumptions.ll PhaseOrdering: Convert tests to opaque pointers 2022-11-27 21:26:41 -05:00
instcombine-sroa-inttoptr.ll PhaseOrdering: Convert tests to opaque pointers 2022-11-27 21:26:41 -05:00
lifetime-sanitizer.ll PhaseOrdering: Convert tests to opaque pointers 2022-11-27 21:26:41 -05:00
loop-rotation-vs-common-code-hoisting.ll PhaseOrdering: Convert tests to opaque pointers 2022-11-27 21:26:41 -05:00
lower-table-based-cttz.ll Recommit "[AggressiveInstCombine] Lower Table Based CTTZ 2022-09-20 13:12:47 +02:00
lto-licm.ll PhaseOrdering: Convert tests to opaque pointers 2022-11-27 21:26:41 -05:00
memset-tail.ll [Passes] add a tail-call-elim pass near the end of the opt pipeline 2022-07-25 15:25:47 -04:00
min-max-abs-cse.ll [Passes] add a tail-call-elim pass near the end of the opt pipeline 2022-07-25 15:25:47 -04:00
minmax.ll [Passes] add a tail-call-elim pass near the end of the opt pipeline 2022-07-25 15:25:47 -04:00
openmp-opt-module.ll PhaseOrdering: Convert tests to opaque pointers 2022-11-27 21:26:41 -05:00
partialord-ule.ll
pr32544.ll PhaseOrdering: Convert tests to opaque pointers 2022-11-27 21:26:41 -05:00
pr36760.ll PhaseOrdering: Convert tests to opaque pointers 2022-11-27 21:26:41 -05:00
pr39116.ll
pr39282.ll PhaseOrdering: Convert tests to opaque pointers 2022-11-27 21:26:41 -05:00
pr40750.ll PhaseOrdering: Convert tests to opaque pointers 2022-11-27 21:26:41 -05:00
pr44461-br-to-switch-rotate.ll [InstCombine] Don't change switch table from desirable to illegal types 2022-10-28 10:15:41 +01:00
pr45682.ll PhaseOrdering: Convert tests to opaque pointers 2022-11-27 21:26:41 -05:00
pr45687.ll [PhaseOrdering] Remove RUN lines for legacy PM (NFC) 2022-04-21 14:43:00 +02:00
reassociate-after-unroll.ll PhaseOrdering: Convert tests to opaque pointers 2022-11-27 21:26:41 -05:00
reassociate-gvn-bdce.ll
reassociate-instcombine.ll [InstCombine] fold udiv with common shl amount in operands 2022-10-12 11:12:26 -04:00
recompute-globalsaa.ll PhaseOrdering: Convert tests to opaque pointers 2022-11-27 21:26:41 -05:00
rotate.ll
scev-custom-dl.ll PhaseOrdering: Convert tests to opaque pointers 2022-11-27 21:26:41 -05:00
scev.ll PhaseOrdering: Convert tests to opaque pointers 2022-11-27 21:26:41 -05:00
simplifycfg-options.ll PhaseOrdering: Convert tests to opaque pointers 2022-11-27 21:26:41 -05:00
simplifycfg-switch-lowering-vs-correlatedpropagation.ll [PhaseOrdering] Remove RUN lines for legacy PM (NFC) 2022-04-21 14:43:00 +02:00
single-iteration-loop-sroa.ll [InstCombine] Revert D125845 2022-11-29 22:02:40 +00:00
srem.ll [SCCP] convert signed div/rem to unsigned for non-negative operands, 2nd try 2022-09-07 11:56:29 -04:00
two-shifts-by-sext.ll PhaseOrdering: Convert tests to opaque pointers 2022-11-27 21:26:41 -05:00
vector-select.ll PhaseOrdering: Convert tests to opaque pointers 2022-11-27 21:26:41 -05:00
vector-trunc-inseltpoison.ll
vector-trunc.ll