|
Revision tags: llvmorg-21-init, llvmorg-19.1.7, 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 |
|
| #
03d8831f |
| 19-Nov-2024 |
Yingwei Zheng <dtcxzyw2333@gmail.com> |
[InstCombine] Handle constant GEP expr in `SimplifyDemandedUseBits` (#116794)
Closes https://github.com/llvm/llvm-project/issues/116775.
|
|
Revision tags: llvmorg-19.1.4 |
|
| #
38fffa63 |
| 06-Nov-2024 |
Paul Walker <paul.walker@arm.com> |
[LLVM][IR] Use splat syntax when printing Constant[Data]Vector. (#112548)
|
|
Revision tags: llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4 |
|
| #
a1058776 |
| 21-Aug-2024 |
Nikita Popov <npopov@redhat.com> |
[InstCombine] Remove some of the complexity-based canonicalization (#91185)
The idea behind this canonicalization is that it allows us to handle less
patterns, because we know that some will be can
[InstCombine] Remove some of the complexity-based canonicalization (#91185)
The idea behind this canonicalization is that it allows us to handle less
patterns, because we know that some will be canonicalized away. This is
indeed very useful to e.g. know that constants are always on the right.
However, this is only useful if the canonicalization is actually
reliable. This is the case for constants, but not for arguments: Moving
these to the right makes it look like the "more complex" expression is
guaranteed to be on the left, but this is not actually the case in
practice. It fails as soon as you replace the argument with another
instruction.
The end result is that it looks like things correctly work in tests,
while they actually don't. We use the "thwart complexity-based
canonicalization" trick to handle this in tests, but it's often a
challenge for new contributors to get this right, and based on the
regressions this PR originally exposed, we clearly don't get this right
in many cases.
For this reason, I think that it's better to remove this complexity
canonicalization. It will make it much easier to write tests for
commuted cases and make sure that they are handled.
show more ...
|
|
Revision tags: llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1 |
|
| #
6157538d |
| 07-Mar-2024 |
Jon Chesterfield <jonathanchesterfield@gmail.com> |
[InstCombine] ptrmask of gep for dynamic pointer aligment (#80002)
Targets the dynamic realignment pattern of `(Ptr + Align - 1) & -Align;`
as implemented by gep then ptrmask.
Specifically, when
[InstCombine] ptrmask of gep for dynamic pointer aligment (#80002)
Targets the dynamic realignment pattern of `(Ptr + Align - 1) & -Align;`
as implemented by gep then ptrmask.
Specifically, when the pointer already has alignment information,
dynamically realigning it to less than is already known should be a
no-op. Discovered while writing test cases for another patch.
For the zero low bits of a known aligned pointer, adding the gep index
then removing it with a mask is a no-op. Folding the ptrmask effect
entirely into the gep is the ideal result as that unblocks other
optimisations that are not aware of ptrmask.
In some other cases the gep is known to be dead and is removed without
changing the ptrmask.
In the least effective case, this transform creates a new gep with a
rounded-down index and still leaves the ptrmask unchanged. That
simplified gep is still a minor improvement, geps are cheap and ptrmask
occurs in address calculation contexts so I don't think it's worth
special casing to avoid the extra instruction.
show more ...
|
|
Revision tags: 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 |
|
| #
bd29197f |
| 22-Sep-2023 |
Noah Goldstein <goldstein.w.n@gmail.com> |
[InstCombine] Fold `(ptrtoint (ptrmask p0, m0))` -> `(and (ptrtoint p0), m0)`
`and` is generally more supported so if we have a `ptrmask` anyways might as well use `and`.
Differential Revision: htt
[InstCombine] Fold `(ptrtoint (ptrmask p0, m0))` -> `(and (ptrtoint p0), m0)`
`and` is generally more supported so if we have a `ptrmask` anyways might as well use `and`.
Differential Revision: https://reviews.llvm.org/D156640
Closes #67166
show more ...
|
| #
cc834187 |
| 22-Sep-2023 |
Noah Goldstein <goldstein.w.n@gmail.com> |
[InstCombine] Preserve return attributes when merging `llvm.ptrmask`
If we have assosiated attributes i.e `([ret_attrs] (ptrmask (ptrmask p0, m0), m1))` we should preserve `[ret_attrs]` when combini
[InstCombine] Preserve return attributes when merging `llvm.ptrmask`
If we have assosiated attributes i.e `([ret_attrs] (ptrmask (ptrmask p0, m0), m1))` we should preserve `[ret_attrs]` when combining the two `llvm.ptrmask`s.
Differential Revision: https://reviews.llvm.org/D156638
show more ...
|
| #
51abbf98 |
| 27-Oct-2023 |
Noah Goldstein <goldstein.w.n@gmail.com> |
[InstCombine] Deduce `align` and `nonnull` return attributes for `llvm.ptrmask`
We can deduce the former based on the mask / incoming pointer alignment. We can set the latter based if know the resu
[InstCombine] Deduce `align` and `nonnull` return attributes for `llvm.ptrmask`
We can deduce the former based on the mask / incoming pointer alignment. We can set the latter based if know the result in non-zero (this is essentially just caching our analysis result).
Differential Revision: https://reviews.llvm.org/D156636
show more ...
|
| #
edb9e9a5 |
| 27-Oct-2023 |
Noah Goldstein <goldstein.w.n@gmail.com> |
[InstCombine] Implement `SimplifyDemandedBits` for `llvm.ptrmask`
Logic basically copies 'and' but we can't return a constant if the result == rhs (mask) so that case is skipped.
|
| #
2c5f2b33 |
| 22-Sep-2023 |
Noah Goldstein <goldstein.w.n@gmail.com> |
[InstCombine] Add tests for combining `llvm.ptrmask`; NFC
Differential Revision: https://reviews.llvm.org/D156634
|