History log of /llvm-project/llvm/test/Transforms/InstCombine/insert-trunc.ll (Results 1 – 8 of 8)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4
# b1094776 11-Apr-2024 Yingwei Zheng <dtcxzyw2333@gmail.com>

[InstCombine] Infer nsw/nuw for trunc (#87910)

This patch adds support for inferring trunc's nsw/nuw flags.


Revision tags: llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7
# 05dbdb00 08-Dec-2022 Sanjay Patel <spatel@rotateright.com>

Revert "[InstCombine] canonicalize trunc + insert as bitcast + shuffle, part 1 (2nd try)"

This reverts commit e71b81cab09bf33e3b08ed600418b72cc4117461.

As discussed in the planned follow-on to this

Revert "[InstCombine] canonicalize trunc + insert as bitcast + shuffle, part 1 (2nd try)"

This reverts commit e71b81cab09bf33e3b08ed600418b72cc4117461.

As discussed in the planned follow-on to this patch (D138874),
this and the subsequent patches in this set can cause trouble for
the backend, and there's probably no quick fix. We may even
want to canonicalize in the opposite direction (towards insertelt).

show more ...


# 286ae63e 08-Dec-2022 Sanjay Patel <spatel@rotateright.com>

Revert "[InstCombine] canonicalize trunc + insert as bitcast + shuffle, part 2"

This reverts commit dd8d0d21ce6d0665ef5d426372096aaed85b479a.
As discussed in the planned follow-on to this patch (D13

Revert "[InstCombine] canonicalize trunc + insert as bitcast + shuffle, part 2"

This reverts commit dd8d0d21ce6d0665ef5d426372096aaed85b479a.
As discussed in the planned follow-on to this patch (D138874),
this and the previous patch in this set can cause trouble for
the backend, and there's probably no quick fix. We may even
want to canonicalize in the opposite direction (towards insertelt).

show more ...


# dd8d0d21 01-Dec-2022 Sanjay Patel <spatel@rotateright.com>

[InstCombine] canonicalize trunc + insert as bitcast + shuffle, part 2

This enhances the base fold from part 1 to allow mapping a
right-shift to an insert index.

Example of translating a middle chu

[InstCombine] canonicalize trunc + insert as bitcast + shuffle, part 2

This enhances the base fold from part 1 to allow mapping a
right-shift to an insert index.

Example of translating a middle chunk of the scalar to vector
for either endian:
https://alive2.llvm.org/ce/z/fRXCOZ

This only allows creating an identity shuffle (with optional
shortening/lengthening) because that is considered the safe
baseline for any target (can be inverted if needed). If we
tried this fold with target-specific costs/legality, then we
could do the transform more generally.

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

show more ...


# e71b81ca 30-Nov-2022 Sanjay Patel <spatel@rotateright.com>

[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, s

[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

show more ...


# 5eacdcff 30-Nov-2022 Sanjay Patel <spatel@rotateright.com>

Revert "[InstCombine] canonicalize trunc + insert as bitcast + shuffle, part 1"

This reverts commit a4c466766db77cd1fb42d7f98f32bb87a3d38829.
This broke clang tests that are wrongly dependent on the

Revert "[InstCombine] canonicalize trunc + insert as bitcast + shuffle, part 1"

This reverts commit a4c466766db77cd1fb42d7f98f32bb87a3d38829.
This broke clang tests that are wrongly dependent on the optimizer.

show more ...


# a4c46676 30-Nov-2022 Sanjay Patel <spatel@rotateright.com>

[InstCombine] canonicalize trunc + insert as bitcast + shuffle, part 1

This is the main patch for converting a truncated scalar that is
inserted into a vector to bitcast+shuffle. We could go either

[InstCombine] canonicalize trunc + insert as bitcast + shuffle, part 1

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

show more ...


Revision tags: llvmorg-15.0.6
# 56279164 22-Nov-2022 Sanjay Patel <spatel@rotateright.com>

[InstCombine] add tests for trunc+insertelt; NFC