History log of /llvm-project/llvm/lib/Transforms/Scalar/MergeICmps.cpp (Results 1 – 25 of 109)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 2d209d96 27-Jun-2024 Nikita Popov <npopov@redhat.com>

[IR] Add getDataLayout() helpers to BasicBlock and Instruction (#96902)

This is a helper to avoid writing `getModule()->getDataLayout()`. I
regularly try to use this method only to remember it does

[IR] Add getDataLayout() helpers to BasicBlock and Instruction (#96902)

This is a helper to avoid writing `getModule()->getDataLayout()`. I
regularly try to use this method only to remember it doesn't exist...

`getModule()->getDataLayout()` is also a common (the most common?)
reason why code has to include the Module.h header.

show more ...


Revision tags: llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3
# 2f1f6b70 23-Mar-2024 Yingwei Zheng <dtcxzyw2333@gmail.com>

[LLVM] Use `std::move` for APInt. NFC. (#86257)

This patch adjusts argument passing for `APInt` to improve the
compile-time.
Compile-time improvement:
https://llvm-compile-time-tracker.com/compar

[LLVM] Use `std::move` for APInt. NFC. (#86257)

This patch adjusts argument passing for `APInt` to improve the
compile-time.
Compile-time improvement:
https://llvm-compile-time-tracker.com/compare.php?from=d1f182c895728d89c5c3d198b133e212a5d9d4a3&to=ba3e326def3a6e5cd6d72ff5a49c74fba18de1df&stat=instructions:u

show more ...


Revision tags: 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
# 4427407a 07-Sep-2023 Jeremy Morse <jeremy.morse@sony.com>

[NFC][RemoveDIs] Create a new spelling of the moveBefore method

As outlined in my proposal of how to get rid of debug intrinsics, this
patch adds a moveBefore method that signals the caller /intends

[NFC][RemoveDIs] Create a new spelling of the moveBefore method

As outlined in my proposal of how to get rid of debug intrinsics, this
patch adds a moveBefore method that signals the caller /intends/ the order
of moved instructions is to stay the same. This semantic difference has an
effect on debug-info, as it signals whether debug-info needs to move with
instructions or not.

The patch just replaces a few calls to moveBefore with calls to
moveBeforePreserving -- and the latter just calls the former, so it's all
NFC right now. A future patch will add an implementation of
moveBeforePreserving that takes action to correctly preserve debug-info,
but that's tightly coupled with our non-instruction debug-info
representation that's still being reviewed.

[0] https://discourse.llvm.org/t/rfc-instruction-api-changes-needed-to-eliminate-debug-intrinsics-from-ir/68939

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

show more ...


Revision tags: llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init
# 39d8e6e2 17-Jun-2023 Elliot Goodrich <elliotgoodrich@gmail.com>

Add missing StringExtras.h includes

In preparation for removing the `#include "llvm/ADT/StringExtras.h"`
from the header to source file of `llvm/Support/Error.h`, first add in
all the missing includ

Add missing StringExtras.h includes

In preparation for removing the `#include "llvm/ADT/StringExtras.h"`
from the header to source file of `llvm/Support/Error.h`, first add in
all the missing includes that were previously included transitively
through this header.

This is fixing all files missed in b0abd4893fa1.

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

show more ...


Revision tags: llvmorg-16.0.6
# df3a8f37 06-Jun-2023 Mikhail Goncharov <goncharov.mikhail@gmail.com>

Revert "Reland [MergeICmps] Adapt to non-eq comparisons, bugfix"

Causes miscompile. See https://reviews.llvm.org/D141188.

This reverts commit fb2c98a929aa65603e9d984307a41325e577e9d3


Revision tags: llvmorg-16.0.5
# a3cc9d19 24-May-2023 Jie Fu <jiefu@tencent.com>

[MergeICmps] Fix -Wsign-compare and typos (NFC)

/data/llvm-project/llvm/lib/Transforms/Scalar/MergeICmps.cpp:623:21: error: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsign

[MergeICmps] Fix -Wsign-compare and typos (NFC)

/data/llvm-project/llvm/lib/Transforms/Scalar/MergeICmps.cpp:623:21: error: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigne
d long') [-Werror,-Wsign-compare]
for (int i = 0; i < Comparisons.size(); i++) {
~ ^ ~~~~~~~~~~~~~~~~~~
1 error generated.

show more ...


# fb2c98a9 24-May-2023 Zhongyunde <zhongyunde@huawei.com>

Reland [MergeICmps] Adapt to non-eq comparisons, bugfix

1.Fix the last runtime issue as some sequent comparisons need be spilted.
For the origin equal comparisons chain, the new spilted Icmp chain w

Reland [MergeICmps] Adapt to non-eq comparisons, bugfix

1.Fix the last runtime issue as some sequent comparisons need be spilted.
For the origin equal comparisons chain, the new spilted Icmp chain will
still be end with equal, while for the new not-equal comparisons chain,
the new spilted Icmp chain will still be end with equal, so should address
this carefully, see detail wih case partial_sequent_ne

2. Fix the mismatch of last link comparison

Thanks for @aeubanks, @glandium and @ayzhao report the runtime issue
and carefully examine.
Fix https://github.com/llvm/llvm-project/issues/59740.

Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D141188

show more ...


Revision tags: llvmorg-16.0.4
# a5595e9f 16-May-2023 Arthur Eubanks <aeubanks@google.com>

Revert "[MergeICmps] Adapt to non-eq comparisons, bugfix"

This reverts commit ae337ed5951c896164e07618d651d086f978ff2c.

Still causes miscompiles, see D141188.


Revision tags: llvmorg-16.0.3
# ae337ed5 25-Apr-2023 Zhongyunde <zhongyunde@huawei.com>

[MergeICmps] Adapt to non-eq comparisons, bugfix

Fix the last runtime issue as some sequent comparisons need be spilted.
For the origin equal comparisons chain, the new spilted Icmp chain will
still

[MergeICmps] Adapt to non-eq comparisons, bugfix

Fix the last runtime issue as some sequent comparisons need be spilted.
For the origin equal comparisons chain, the new spilted Icmp chain will
still be end with equal, while for the new not-equal comparisons chain,
the new spilted Icmp chain will still be end with equal, so should address
this carefully, see detail wih case partial_sequent_ne

Thanks for @aeubanks, @glandium and @ayzhao report the runtime issue
and carefully examine.
Fix https://github.com/llvm/llvm-project/issues/59740.

Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D141188

show more ...


# 3db8ae1f 27-Apr-2023 Arthur Eubanks <aeubanks@google.com>

Revert "[MergeICmps] Adapt to non-eq comparisons, bugfix"

This reverts commit ca94b02e559242e6d1fcdd65320334438be69448.

Causes miscompiles, see D141188


# ca94b02e 25-Apr-2023 Zhongyunde <zhongyunde@huawei.com>

[MergeICmps] Adapt to non-eq comparisons, bugfix

Fix the last runtime issue as some sequent comparisons need be spilted.
For the origin equal comparisons chain, the new spilted Icmp chain will
still

[MergeICmps] Adapt to non-eq comparisons, bugfix

Fix the last runtime issue as some sequent comparisons need be spilted.
For the origin equal comparisons chain, the new spilted Icmp chain will
still be end with equal, while for the new not-equal comparisons chain,
the new spilted Icmp chain will still be end with equal, so should address
this carefully, see detail wih case partial_sequent_ne

Thanks for @aeubanks, @glandium and @ayzhao report the runtime issue
and carefully examine.
Fix https://github.com/llvm/llvm-project/issues/59740.

Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D141188

show more ...


Revision tags: llvmorg-16.0.2
# 0e739ddd 08-Apr-2023 Zhongyunde <zhongyunde@huawei.com>

[MergeICmps] Attach metadata to new created loads

Use clone to keep the metadata, the issue is reported
by aeubanks on D141188.

Reviewed By: nikic, paulwalker-arm

Differential Revision: https://re

[MergeICmps] Attach metadata to new created loads

Use clone to keep the metadata, the issue is reported
by aeubanks on D141188.

Reviewed By: nikic, paulwalker-arm

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

show more ...


Revision tags: llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4
# 916425b2 23-Feb-2023 Krzysztof Drewniak <Krzysztof.Drewniak@amd.com>

[llvm] Use pointer index type for more GEP offsets (pre-codegen)

Many uses of getIntPtrType() were using that type to calculate the
neened type for GEP offset arguments. However, some time ago,
Data

[llvm] Use pointer index type for more GEP offsets (pre-codegen)

Many uses of getIntPtrType() were using that type to calculate the
neened type for GEP offset arguments. However, some time ago,
DataLayout was extended to support pointers where the size of the
pointer is not equal to the size of the values used to index it.

Much code was already migrated to, for example, use getIndexSizeInBits
instead of getPtrSizeInBits, but some rewrites still used
getIntPtrType() to get the type for GEP offsets.

This commit changes uses of getIntPtrType() to getIndexType() where
they are involved in a GEP-related calculation.

In at least one case (bounds check insertion) this resolves a compiler
crash that the new test added here would previously trigger.

This commit does not impact
- C library-related rewriting (memcpy()), which are operating under
the assumption that intptr_t == size_t. While all the mechanisms for
breaking this assumption now exist, doing so is outside the scope of
this commit.
- Code generation and below. Note that the use of getIntPtrType() in
CodeGenPrepare will be changed in a future commit.
- Usage of getIntPtrType() in any backend

Depends on D143435

Reviewed By: arichardson

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

show more ...


# 1929aa8f 10-Mar-2023 Arthur Eubanks <aeubanks@google.com>

Revert "[MergeICmps] Adapt to non-eq comparisons, fix bug for cases need be spilted"

This reverts commit 818e554e251c1e07f133aeed9fe0473502ebfdae.

Causes miscompiles, see comments on D141188.


# 818e554e 09-Mar-2023 zhongyunde <zhongyunde@huawei.com>

[MergeICmps] Adapt to non-eq comparisons, fix bug for cases need be spilted

Fix the last runtime issue as some sequent comparisons need be spilted.
For the origin equal comparisons chain, the new sp

[MergeICmps] Adapt to non-eq comparisons, fix bug for cases need be spilted

Fix the last runtime issue as some sequent comparisons need be spilted.
For the origin equal comparisons chain, the new spilted Icmp chain will
still be end with equal, while for the new not-equal comparisons chain,
the new spilted Icmp chain will still be end with equal, so should address
this carefully, see detail wih case partial_sequent_ne.

Thanks for @glandium and @ayzhao report the runtime issue and carefully
examine.
Fix https://github.com/llvm/llvm-project/issues/59740.

Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D141188

show more ...


# af2969fd 02-Mar-2023 Zhongyunde <zhongyunde@huawei.com>

Revert "[MergeICmps] Adapt to non-eq comparisons, retry"

This reverts commit 74ad19c25d7217d8f580a21d12fd4c784a1a0094.

test unittests/ProfileData/ProfileDataTests fails when built with
optimisation

Revert "[MergeICmps] Adapt to non-eq comparisons, retry"

This reverts commit 74ad19c25d7217d8f580a21d12fd4c784a1a0094.

test unittests/ProfileData/ProfileDataTests fails when built with
optimisations level -O1 with clang including this patch.

show more ...


# 74ad19c2 26-Feb-2023 zhongyunde <zhongyunde@huawei.com>

[MergeICmps] Adapt to non-eq comparisons, retry

Fix https://github.com/llvm/llvm-project/issues/59740.
NOTE: retry as we can't reproduce the break locally when first commit.

Reviewed By: vitalybuka

[MergeICmps] Adapt to non-eq comparisons, retry

Fix https://github.com/llvm/llvm-project/issues/59740.
NOTE: retry as we can't reproduce the break locally when first commit.

Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D141188

show more ...


Revision tags: llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init
# 46a8d577 13-Jan-2023 Vitaly Buka <vitalybuka@google.com>

Revert "[MergeICmps] Adapt to non-eq comparisons"

Breaks ubsan build, details in D141188.

This reverts commit 3ac2b3a4f9effc9f79822e770f209fd70ff66362.


Revision tags: llvmorg-15.0.7
# 3ac2b3a4 12-Jan-2023 zhongyunde <zhongyunde@huawei.com>

[MergeICmps] Adapt to non-eq comparisons

Fix https://github.com/llvm/llvm-project/issues/59740.

Reviewed By: courbet, nikic
Differential Revision: https://reviews.llvm.org/D141188


# 31521563 13-Dec-2022 Fangrui Song <i@maskray.me>

[Transforms/Scalar] llvm::Optional => std::optional


# 343de685 03-Dec-2022 Kazu Hirata <kazu@google.com>

[Transforms] Use std::nullopt instead of None (NFC)

This patch mechanically replaces None with std::nullopt where the
compiler would warn if None were deprecated. The intent is to reduce
the amount

[Transforms] Use std::nullopt instead of None (NFC)

This patch mechanically replaces None with std::nullopt where the
compiler would warn if None were deprecated. The intent is to reduce
the amount of manual work required in migrating from Optional to
std::optional.

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

show more ...


Revision tags: llvmorg-15.0.6, llvmorg-15.0.5
# cfb0d628 15-Nov-2022 Fraser Cormack <fraser@codeplay.com>

[MergeICmps][NFC] Fix a couple of typos in a comment


Revision tags: llvmorg-15.0.4, llvmorg-15.0.3, working, llvmorg-15.0.2
# aa1b64cc 28-Sep-2022 Bjorn Pettersson <bjorn.a.pettersson@ericsson.com>

[BuildLibCalls] Use TLI to get 'int' and 'size_t' type sizes

Stop assuming that an 'int' is 32 bits in helpers that emit libcalls
to lib functions that had 'int' in the signature. For most targets
t

[BuildLibCalls] Use TLI to get 'int' and 'size_t' type sizes

Stop assuming that an 'int' is 32 bits in helpers that emit libcalls
to lib functions that had 'int' in the signature. For most targets
this is NFC. For a target with 16 bit 'int' type this could help out
detecting if trying to emit a libcall with incorrect signature.

Similarly we now derive the type mapping to 'size_t' by asking TLI
about the size of 'size_t'. This should be NFC (at least for in-tree
targets) since getSizeTSize(), in TLI, is deriving the size in the
same way as DataLayout::getIntPtrType().

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

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, llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1, llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2
# d3a52089 25-Feb-2022 Nikita Popov <npopov@redhat.com>

Reapply [MergeICmps] Don't require GEP

Recommit without changes over 53abe3ff66a54117308352d379837c7d3229f8d6,
which addressed the cause of the reported crash.

-----

With opaque pointers, the zero

Reapply [MergeICmps] Don't require GEP

Recommit without changes over 53abe3ff66a54117308352d379837c7d3229f8d6,
which addressed the cause of the reported crash.

-----

With opaque pointers, the zero-offset load will generally not use
a GEP. Allow a direct load without GEP, which is treated the same
way as a zero-offset GEP.

show more ...


# 53abe3ff 04-Mar-2022 Nikita Popov <npopov@redhat.com>

[MergeICmp] Make instruction move robust against empty block (NFCI)

Use the overload that support moving into an empty block. I don't
think that this situation can occur right now, but it can happen

[MergeICmp] Make instruction move robust against empty block (NFCI)

Use the overload that support moving into an empty block. I don't
think that this situation can occur right now, but it can happen
with the change from e7fb1c15cb85d748c1c4fdd5a2eb5613ec7bef1d,
and the test is derived from the issue reported there.

show more ...


12345