diff options
author | Sanjay Patel <spatel@rotateright.com> | 2022-11-30 14:48:32 -0500 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2022-11-30 14:52:20 -0500 |
commit | e71b81cab09bf33e3b08ed600418b72cc4117461 (patch) | |
tree | e932e9e69bcb5a4201c42463a283a9e245fa590a /llvm/lib/CodeGen/CodeGen.cpp | |
parent | d5b0de35bdd9a3f4d4a093e7938b06add34678eb (diff) | |
download | llvm-e71b81cab09bf33e3b08ed600418b72cc4117461.zip llvm-e71b81cab09bf33e3b08ed600418b72cc4117461.tar.gz llvm-e71b81cab09bf33e3b08ed600418b72cc4117461.tar.bz2 |
[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
Diffstat (limited to 'llvm/lib/CodeGen/CodeGen.cpp')
0 files changed, 0 insertions, 0 deletions