History log of /llvm-project/llvm/test/Transforms/InstCombine/opaque-ptr.ll (Results 1 – 25 of 44)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init, llvmorg-19.1.7
# a4d92400 03-Jan-2025 Yingwei Zheng <dtcxzyw2333@gmail.com>

[InstCombine] Fix GEPNoWrapFlags propagation in `foldGEPOfPhi` (#121572)

Closes https://github.com/llvm/llvm-project/issues/121459.


Revision tags: llvmorg-19.1.6
# 462cb3cd 05-Dec-2024 Nikita Popov <npopov@redhat.com>

[InstCombine] Infer nusw + nneg -> nuw for getelementptr (#111144)

If the gep is nusw (usually via inbounds) and the offset is
non-negative, we can infer nuw.

Proof: https://alive2.llvm.org/ce/z

[InstCombine] Infer nusw + nneg -> nuw for getelementptr (#111144)

If the gep is nusw (usually via inbounds) and the offset is
non-negative, we can infer nuw.

Proof: https://alive2.llvm.org/ce/z/ihztLy

show more ...


Revision tags: llvmorg-19.1.5, llvmorg-19.1.4
# 929cbe7f 12-Nov-2024 Antonio Frighetto <me@antoniofrighetto.com>

[InstCombine] Intersect nowrap flags between geps while folding into phi

A miscompilation issue has been addressed with refined checking.

Fixes: https://github.com/llvm/llvm-project/issues/115149.


Revision tags: llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3
# cc14ecc2 12-Aug-2024 Nikita Popov <npopov@redhat.com>

[InstCombine] Don't change fn signature for calls to declarations (#102596)

transformConstExprCastCall() implements a number of highly dubious
transforms attempting to make a call function type lin

[InstCombine] Don't change fn signature for calls to declarations (#102596)

transformConstExprCastCall() implements a number of highly dubious
transforms attempting to make a call function type line up with the
function type of the called function. Historically, the main value this
had was to avoid function type mismatches due to pointer type
differences, which is no longer relevant with opaque pointers.

This patch is a step towards reducing the scope of the transform, by
applying it only to definitions, not declarations. For declarations, the
declared signature might not match the actual function signature, e.g.
`void @fn()` is sometimes used as a placeholder for functions with
unknown signature. The implementation already bailed out in some cases
for declarations, but I think it would be safer to disable the transform
entirely.

For the test cases, I've updated some of them to use definitions
instead, so that the test coverage is preserved.

show more ...


Revision tags: llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init
# 6467b494 19-Jun-2024 Nikita Popov <npopov@redhat.com>

[InstCombine] Preserve all flags in phi of gep fold

Preserve the intersection of all flags. Add GEPNoWrapFlags::all()
to serve as the initialization value for the intersection.


# 4c8ce5d3 19-Jun-2024 Nikita Popov <npopov@redhat.com>

[InstCombine] Preserve all flags in select of gep fold

Preserve the flag intersection.


Revision tags: llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5
# 74aa1abf 01-May-2024 Nikita Popov <npopov@redhat.com>

[InstCombine] Canonicalize scalable GEPs to use llvm.vscale intrinsic (#90569)

Canonicalize getelementptr instructions for scalable vector types into
ptradd representation with an explicit llvm.vsc

[InstCombine] Canonicalize scalable GEPs to use llvm.vscale intrinsic (#90569)

Canonicalize getelementptr instructions for scalable vector types into
ptradd representation with an explicit llvm.vscale call. This
representation has better support in BasicAA, which can reason about
llvm.vscale, but not plain scalable GEPs.

show more ...


Revision tags: llvmorg-18.1.4, 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
# 90ba3309 24-Jan-2024 Nikita Popov <npopov@redhat.com>

[InstCombine] Canonicalize constant GEPs to i8 source element type (#68882)

This patch canonicalizes getelementptr instructions with constant
indices to use the `i8` source element type. This makes

[InstCombine] Canonicalize constant GEPs to i8 source element type (#68882)

This patch canonicalizes getelementptr instructions with constant
indices to use the `i8` source element type. This makes it easier for
optimizations to recognize that two GEPs are identical, because they
don't need to see past many different ways to express the same offset.

This is a first step towards
https://discourse.llvm.org/t/rfc-replacing-getelementptr-with-ptradd/68699.
This is limited to constant GEPs only for now, as they have a clear
canonical form, while we're not yet sure how exactly to deal with
variable indices.

The test llvm/test/Transforms/PhaseOrdering/switch_with_geps.ll gives
two representative examples of the kind of optimization improvement we
expect from this change. In the first test SimplifyCFG can now realize
that all switch branches are actually the same. In the second test it
can convert it into simple arithmetic. These are representative of
common optimization failures we see in Rust.

Fixes https://github.com/llvm/llvm-project/issues/69841.

show more ...


Revision tags: llvmorg-19-init, llvmorg-17.0.6
# d01237c4 28-Nov-2023 Nikita Popov <npopov@redhat.com>

[InstCombine] Make indexed compare fold GEP source type independent (#71663)

The indexed compare fold converts comparisons of GEPs with same
(indirect) base into comparisons of offset. Currently, i

[InstCombine] Make indexed compare fold GEP source type independent (#71663)

The indexed compare fold converts comparisons of GEPs with same
(indirect) base into comparisons of offset. Currently, it only supports
GEPs with the same source element type.

This change makes the transform operate on offsets instead, which
removes the type dependence. To keep closer to the scope of the original
implementation, this keeps the limitation that we should only have at
most one variable index per GEP.

This addresses the main regression from
https://github.com/llvm/llvm-project/pull/68882.

TBH I have some doubts that this is really a useful transform (at least
for the case where there are extra pointer users, so we have to
rematerialize pointers at some point). I can only assume it exists for a
reason...

show more ...


Revision tags: 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
# c7d65e44 11-Aug-2023 Paul Walker <paul.walker@arm.com>

[IR] Enable load/store/alloca for arrays of scalable vectors.

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


Revision tags: llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init
# edb2fc6d 12-Jul-2023 Nikita Popov <npopov@redhat.com>

[llvm] Remove explicit -opaque-pointers flag from tests (NFC)

Opaque pointers mode is enabled by default, no need to explicitly
enable it.


Revision tags: 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
# 81ac4644 02-Jan-2023 Nikita Popov <npopov@redhat.com>

[InstCombine] Support vectors in icmp of GEP fold

EmitGEPOffset() supports vector GEPs nowadays, so we don't need
any further code changes.

compare_gep_with_base_vector1 shows a weakness in folding

[InstCombine] Support vectors in icmp of GEP fold

EmitGEPOffset() supports vector GEPs nowadays, so we don't need
any further code changes.

compare_gep_with_base_vector1 shows a weakness in folding the
resulting comparison if an index splat has to be performed.

show more ...


# a21458c7 02-Jan-2023 Nikita Popov <npopov@redhat.com>

[InstCombine] Add tests for icmp of vector GEP (NFC)

These show up as regressions with opaque pointers.


# 8c42da53 05-Dec-2022 Simon Pilgrim <llvm-dev@redking.me.uk>

[InstCombine] Regenerate opaque-ptr.ll test checks

Fixes superfluous diffs identified in D139253


Revision tags: llvmorg-15.0.6
# 0676acb6 29-Nov-2022 Bjorn Pettersson <bjorn.a.pettersson@ericsson.com>

[test] Switch to use -passes syntax in a bunch of test cases

Should cover most of the tests for GVN, GVNHoist, GVNSink, GlobalOpt,
GlobalSplit, InstCombine, Reassociate, SROA and TailCallElim that
h

[test] Switch to use -passes syntax in a bunch of test cases

Should cover most of the tests for GVN, GVNHoist, GVNSink, GlobalOpt,
GlobalSplit, InstCombine, Reassociate, SROA and TailCallElim that
had not been updated earlier.

show more ...


Revision tags: llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, working, llvmorg-15.0.2
# 4ab40eca 03-Oct-2022 Bjorn Pettersson <bjorn.a.pettersson@ericsson.com>

[test][InstCombine] Update some test cases to use opaque pointers

These tests cases were converted using the script at
https://gist.github.com/nikic/98357b71fd67756b0f064c9517b62a34

Differential Re

[test][InstCombine] Update some test cases to use opaque pointers

These tests cases were converted using the script at
https://gist.github.com/nikic/98357b71fd67756b0f064c9517b62a34

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

show more ...


Revision tags: llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init
# a9119143 30-Jun-2022 William Huang <williamjhuang@google.com>

[InstCombine] Changing constant-indexed GEP of GEP to i8* for merging

When merging GEP of GEP with constant indices, if the second GEP's offset is not divisible by the first GEP's element size, conv

[InstCombine] Changing constant-indexed GEP of GEP to i8* for merging

When merging GEP of GEP with constant indices, if the second GEP's offset is not divisible by the first GEP's element size, convert both type to i8* and merge.

Reviewed By: nikic

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

show more ...


Revision tags: llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4
# d222bab6 10-May-2022 Nikita Popov <npopov@redhat.com>

[InstCombine] Handle GEP scalar/vector base mismatch (PR55363)

30a12f3f6322399185fdceffe176152a58bb84ae switched the type check
to use the GEP result type rather than the GEP operand type.
However,

[InstCombine] Handle GEP scalar/vector base mismatch (PR55363)

30a12f3f6322399185fdceffe176152a58bb84ae switched the type check
to use the GEP result type rather than the GEP operand type.
However, the GEP result types may match even if the operand types
don't, in case GEPs with scalar/vector base and vector index
are compared.

Fixes https://github.com/llvm/llvm-project/issues/55363.

show more ...


Revision tags: llvmorg-14.0.3
# c103f5e9 26-Apr-2022 Nikita Popov <npopov@redhat.com>

[InstCombine] Combine opaque pointer GEPs with mismatching element types

Currently, two GEPs will only be combined if the result element
type of one is the same as the source element type of the oth

[InstCombine] Combine opaque pointer GEPs with mismatching element types

Currently, two GEPs will only be combined if the result element
type of one is the same as the source element type of the other.
However, this means we may miss folding opportunities where the
second GEP could be rewritten using a different element type. This
is especially relevant for opaque pointers, where constant GEPs
often use i8 element type.

Address this by converting GEP indices to offsets, adding them,
and then converting them back to indices. The first (inner) GEP
is allowed to have variable indices as well, in which case only
the constant suffix is converted into an offset.

This should address the regression reported in
https://reviews.llvm.org/D123300#3467615.

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

show more ...


# 257b39fb 26-Apr-2022 Nikita Popov <npopov@redhat.com>

[InstCombine] Add extra use tests for GEP of GEP fold (NFC)


# f9d56572 26-Apr-2022 Nikita Popov <npopov@redhat.com>

[InstCombine] Add tests for GEP of GEP with opaque pointers (NFC)

Test cases with element type mismatch, some of which can still
be combined.


Revision tags: llvmorg-14.0.2, llvmorg-14.0.1, llvmorg-14.0.0, llvmorg-14.0.0-rc4
# 80645080 11-Mar-2022 Nikita Popov <npopov@redhat.com>

[ConstFold] Don't fold calls with mismatching function type

With opaque pointers, this is no longer ensured through pointer
type identity.


Revision tags: llvmorg-14.0.0-rc3
# c1b96671 03-Mar-2022 Nikita Popov <npopov@redhat.com>

[InstCombine] Support opaque pointers in callee bitcast fold

To make this actually trigger, we also need to check whether the
function types differ, which is a hidden cast under opaque pointers.
The

[InstCombine] Support opaque pointers in callee bitcast fold

To make this actually trigger, we also need to check whether the
function types differ, which is a hidden cast under opaque pointers.
The transform is somewhat less relevant there because it is
primarily about pointer bitcasts, but it can also happen with other
bit- or pointer-castable types.

Byval handling is easier with opaque pointers because there is no
need to adjust the byval type, we only need to make sure that it's
still a pointer.

show more ...


Revision tags: llvmorg-14.0.0-rc2
# 4a26abc0 17-Feb-2022 Arthur Eubanks <aeubanks@google.com>

[InstCombine][OpaquePtr] Check store type in DSE implementation


# 7c83f8c4 14-Feb-2022 Nikita Popov <npopov@redhat.com>

[InstCombine] Check GEP source type in select of gep fold

This is no longer implicitly checked through the pointer type
with opaque pointers.


12