|
Revision tags: llvmorg-20.1.0, llvmorg-20.1.0-rc3, llvmorg-20.1.0-rc2, llvmorg-20.1.0-rc1, llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, 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, 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, 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, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, llvmorg-15.0.2, 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 <[email protected]> |
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 <[email protected]> |
[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 ...
|
| #
bc1574b4 |
| 03-Mar-2022 |
Arthur Eubanks <[email protected]> |
Revert "[MergeICmps] Don't require GEP"
This reverts commit e7fb1c15cb85d748c1c4fdd5a2eb5613ec7bef1d.
Causes crashes, see https://reviews.llvm.org/rGe7fb1c15cb85d748c1c4fdd5a2eb5613ec7bef1d.
|
| #
e7fb1c15 |
| 25-Feb-2022 |
Nikita Popov <[email protected]> |
[MergeICmps] Don't require GEP
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.
|
| #
3c0096a1 |
| 22-Feb-2022 |
Nikita Popov <[email protected]> |
[MergeICmps] Don't call comesBefore() if in different blocks (PR53959)
Only call comesBefore() if the instructions are in the same block. Otherwise make a conservative assumption.
Fixes https://git
[MergeICmps] Don't call comesBefore() if in different blocks (PR53959)
Only call comesBefore() if the instructions are in the same block. Otherwise make a conservative assumption.
Fixes https://github.com/llvm/llvm-project/issues/53959.
show more ...
|
|
Revision tags: llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2, llvmorg-13.0.1-rc1, llvmorg-13.0.0, llvmorg-13.0.0-rc4 |
|
| #
e4a1af37 |
| 21-Sep-2021 |
Nikita Popov <[email protected]> |
[MergeICmps] Remove unused NumMerged variable
|
| #
f2fa6ad0 |
| 18-Sep-2021 |
Nikita Popov <[email protected]> |
[MergeICmps] Don't reorder unmerged comparisons
MergeICmps will currently sort (by offset) all comparisons in a chain, including those that do not get merged. This is problematic in two ways:
* We
[MergeICmps] Don't reorder unmerged comparisons
MergeICmps will currently sort (by offset) all comparisons in a chain, including those that do not get merged. This is problematic in two ways:
* We may end up moving the original first block into the middle of the chain, in which case the "extra work" instructions will also be in the middle of the chain, resulting in invalid IR (reported in https://reviews.llvm.org/D108782#3005583). * Reordering branches is generally not legal, because it may introduce branch on poison, which is UB (PR51845). The merging done by MergeICmps is legal as long as we assume that memcmp() works on frozen memory, but the reordering of unmerged comparisons is definitely incorrect (without inserting freeze instructions), so we should avoid it.
There are easier ways to fix the first issue, but I figured it was worthwhile to do this properly to also fix the second one. What we now do is to restore the original relative order of (potentially merged) comparisons.
I took the liberty of dropping the MERGEICMPS_DOT_ON functionality, because it would be more awkward to implement now (as the before and after representation is different) and it doesn't seem terribly useful nowadays.
Differential Revision: https://reviews.llvm.org/D110024
show more ...
|
| #
e2febc2e |
| 17-Sep-2021 |
Kazu Hirata <[email protected]> |
[llvm] Use drop_begin (NFC)
|
|
Revision tags: llvmorg-13.0.0-rc3 |
|
| #
757409da |
| 26-Aug-2021 |
Nikita Popov <[email protected]> |
[MergeICmps] Ignore clobbering instructions before the loads
This is another followup to D106591. Even if there is an instruction that clobbers one of the loads, this doesn't matter if it happens be
[MergeICmps] Ignore clobbering instructions before the loads
This is another followup to D106591. Even if there is an instruction that clobbers one of the loads, this doesn't matter if it happens before the loads. Those instructions aren't affected by the transform at all.
The gep-references-bb.ll is modified to preserve the spirit of the test, as the store to @g no longer impacts the transform.
Differential Revision: https://reviews.llvm.org/D108782
show more ...
|
| #
4cacb5ca |
| 27-Aug-2021 |
Valentin Churavy <[email protected]> |
[MergeICmps] Don't merge icmps derived from pointers with addressspaces
IIUC we can't emit `memcmp` between pointers in addressspaces, doing so will trigger an assertion since the signature of the m
[MergeICmps] Don't merge icmps derived from pointers with addressspaces
IIUC we can't emit `memcmp` between pointers in addressspaces, doing so will trigger an assertion since the signature of the memcmp will not match it's arguments (https://bugs.llvm.org/show_bug.cgi?id=48661).
This PR disables the attempt to merge icmps, when the pointer is in an addressspace.
Reviewed By: #julialang, vtjnash
Differential Revision: https://reviews.llvm.org/D94813
show more ...
|
|
Revision tags: llvmorg-13.0.0-rc2 |
|
| #
19dc02e9 |
| 22-Aug-2021 |
Nikita Popov <[email protected]> |
[MergeICmps] Allow sinking past non-load/store
This is a followup to D106591. MergeICmps currently only allows sinking the loads past either instructions that don't write to memory at all, or simple
[MergeICmps] Allow sinking past non-load/store
This is a followup to D106591. MergeICmps currently only allows sinking the loads past either instructions that don't write to memory at all, or simple loads/stores that don't modify the memory the loads access.
The "simple loads/stores" part of this check doesn't seem necessary to me -- AA isModRef() already accurately models any operation that may clobber the memory. For example, in the adjusted test case the transform is still fine if the call to @foo() isn't readonly, but inaccessiblememonly -- in both cases, the call cannot modify the loaded memory.
Differential Revision: https://reviews.llvm.org/D108517
show more ...
|
|
Revision tags: llvmorg-13.0.0-rc1, llvmorg-14-init |
|
| #
f921bf60 |
| 26-Jul-2021 |
Nikita Popov <[email protected]> |
[MergeICmps] Collect block instructions once (NFC)
Collect the relevant instructions for a given BCECmpBlock once on construction, rather than repeating this logic in multiple places.
|
| #
c691651c |
| 26-Jul-2021 |
Nikita Popov <[email protected]> |
[MergeICmps] Try to fix MSVC build failure
Apparently this fails to line up the types -- try to sidestep the issue entirely by writing the code in a more reasonable way: Walk over the operands and p
[MergeICmps] Try to fix MSVC build failure
Apparently this fails to line up the types -- try to sidestep the issue entirely by writing the code in a more reasonable way: Walk over the operands and perform a set lookup, rather than walking over the set and performing an operand scan.
show more ...
|
| #
0d3807b3 |
| 26-Jul-2021 |
Nikita Popov <[email protected]> |
[MergeICmps] Separate out BCECmp and use Optional (NFC)
Separate out the BCECmp part from BCECmpBlock, which just stores the comparison atoms without the branch instruction. At the same time switch
[MergeICmps] Separate out BCECmp and use Optional (NFC)
Separate out the BCECmp part from BCECmpBlock, which just stores the comparison atoms without the branch instruction. At the same time switch the code to return Optional<> rather than objects in invalid state and partially constructed objects.
show more ...
|
| #
f5026837 |
| 22-Jul-2021 |
Nikita Popov <[email protected]> |
[MergeICmps] Relax sinking check
The check for sinking instructions past the load + cmp sequence currently checks for side-effects, which includes writing to memory and unwinding. However, I don't b
[MergeICmps] Relax sinking check
The check for sinking instructions past the load + cmp sequence currently checks for side-effects, which includes writing to memory and unwinding. However, I don't believe we care about sinking the instructions past an unwind (as they don't have any side-effects themselves).
Differential Revision: https://reviews.llvm.org/D106591
show more ...
|
| #
1def2579 |
| 08-Jul-2021 |
David Blaikie <[email protected]> |
PR51018: Remove explicit conversions from SmallString to StringRef to future-proof against C++23
C++23 will make these conversions ambiguous - so fix them to make the codebase forward-compatible wit
PR51018: Remove explicit conversions from SmallString to StringRef to future-proof against C++23
C++23 will make these conversions ambiguous - so fix them to make the codebase forward-compatible with C++23 (& a follow-up change I've made will make this ambiguous/invalid even in <C++23 so we don't regress this & it generally improves the code anyway)
show more ...
|
|
Revision tags: llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3, llvmorg-12.0.1-rc2, llvmorg-12.0.1-rc1 |
|
| #
6b9524a0 |
| 06-May-2021 |
Arthur Eubanks <[email protected]> |
[NewPM] Don't mark AA analyses as preserved
Currently all AA analyses marked as preserved are stateless, not taking into account their dependent analyses. So there's no need to mark them as preserve
[NewPM] Don't mark AA analyses as preserved
Currently all AA analyses marked as preserved are stateless, not taking into account their dependent analyses. So there's no need to mark them as preserved, they won't be invalidated unless their analyses are.
SCEVAAResults was the one exception to this, it was treated like a typical analysis result. Make it like the others and don't invalidate unless SCEV is invalidated.
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D102032
show more ...
|
| #
fb9ed197 |
| 15-May-2021 |
Nikita Popov <[email protected]> |
[IR] Add BasicBlock::isEntryBlock() (NFC)
This is a recurring and somewhat awkward pattern. Add a helper method for it.
|
| #
e60d6e91 |
| 23-Apr-2021 |
Timm Bäder <[email protected]> |
[llvm][NFC] Fix assert indentation
This triggers GCC's misleading-indentation checker.
|
|
Revision tags: llvmorg-12.0.0, llvmorg-12.0.0-rc5, llvmorg-12.0.0-rc4, llvmorg-12.0.0-rc3, llvmorg-12.0.0-rc2 |
|
| #
fb74e1e7 |
| 05-Feb-2021 |
Kazu Hirata <[email protected]> |
[Transforms/Scalar] Use range-based for loops (NFC)
|
|
Revision tags: llvmorg-11.1.0, llvmorg-11.1.0-rc3, llvmorg-12.0.0-rc1, llvmorg-13-init, llvmorg-11.1.0-rc2, llvmorg-11.1.0-rc1 |
|
| #
4d92ab16 |
| 09-Jan-2021 |
Kazu Hirata <[email protected]> |
[Transforms] Use llvm::find_if (NFC)
|
|
Revision tags: llvmorg-11.0.1, llvmorg-11.0.1-rc2 |
|
| #
735e6c88 |
| 01-Dec-2020 |
Clement Courbet <[email protected]> |
[MergeICmps] Fix missing split.
We were not correctly splitting a blocks for chains of length 1.
Before that change, additional instructions for blocks in chains of length 1 were not split off from
[MergeICmps] Fix missing split.
We were not correctly splitting a blocks for chains of length 1.
Before that change, additional instructions for blocks in chains of length 1 were not split off from the block before removing (this was done correctly for chains of longer size). If this first block contained an instruction referenced elsewhere, deleting the block, would result in invalidation of the produced value.
This caused a miscompile which motivated D92297 (before D17993, nonnull and dereferenceable attributed were not added so MergeICmps were not triggered.) The new test gep-references-bb.ll demonstrate the issue.
The regression was introduced in rG0efadbbcdeb82f5c14f38fbc2826107063ca48b2.
This supersedes D92364.
Test case by MaskRay (Fangrui Song).
Differential Revision: https://reviews.llvm.org/D92375
show more ...
|
|
Revision tags: llvmorg-11.0.1-rc1 |
|
| #
6aa10ae5 |
| 08-Oct-2020 |
Simon Pilgrim <[email protected]> |
[Transforms] visitCmpBlock - don't dereference a dyn_cast<>. NFCI.
Use cast<> as we immediately dereference the pointer afterwards - cast<> will assert if we fail.
Prevents clang static analyzer wa
[Transforms] visitCmpBlock - don't dereference a dyn_cast<>. NFCI.
Use cast<> as we immediately dereference the pointer afterwards - cast<> will assert if we fail.
Prevents clang static analyzer warning that we could deference a null pointer.
show more ...
|
|
Revision tags: llvmorg-11.0.0, llvmorg-11.0.0-rc6, llvmorg-11.0.0-rc5, llvmorg-11.0.0-rc4, llvmorg-11.0.0-rc3, llvmorg-11.0.0-rc2, llvmorg-11.0.0-rc1, llvmorg-12-init, llvmorg-10.0.1, llvmorg-10.0.1-rc4, llvmorg-10.0.1-rc3, llvmorg-10.0.1-rc2, llvmorg-10.0.1-rc1, llvmorg-10.0.0, llvmorg-10.0.0-rc6, llvmorg-10.0.0-rc5, llvmorg-10.0.0-rc4, llvmorg-10.0.0-rc3, llvmorg-10.0.0-rc2, llvmorg-10.0.0-rc1, llvmorg-11-init, llvmorg-9.0.1, llvmorg-9.0.1-rc3, llvmorg-9.0.1-rc2, llvmorg-9.0.1-rc1 |
|
| #
05da2fe5 |
| 13-Nov-2019 |
Reid Kleckner <[email protected]> |
Sink all InitializePasses.h includes
This file lists every pass in LLVM, and is included by Pass.h, which is very popular. Every time we add, remove, or rename a pass in LLVM, it caused lots of reco
Sink all InitializePasses.h includes
This file lists every pass in LLVM, and is included by Pass.h, which is very popular. Every time we add, remove, or rename a pass in LLVM, it caused lots of recompilation.
I found this fact by looking at this table, which is sorted by the number of times a file was changed over the last 100,000 git commits multiplied by the number of object files that depend on it in the current checkout: recompiles touches affected_files header 342380 95 3604 llvm/include/llvm/ADT/STLExtras.h 314730 234 1345 llvm/include/llvm/InitializePasses.h 307036 118 2602 llvm/include/llvm/ADT/APInt.h 213049 59 3611 llvm/include/llvm/Support/MathExtras.h 170422 47 3626 llvm/include/llvm/Support/Compiler.h 162225 45 3605 llvm/include/llvm/ADT/Optional.h 158319 63 2513 llvm/include/llvm/ADT/Triple.h 140322 39 3598 llvm/include/llvm/ADT/StringRef.h 137647 59 2333 llvm/include/llvm/Support/Error.h 131619 73 1803 llvm/include/llvm/Support/FileSystem.h
Before this change, touching InitializePasses.h would cause 1345 files to recompile. After this change, touching it only causes 550 compiles in an incremental rebuild.
Reviewers: bkramer, asbirlea, bollu, jdoerfert
Differential Revision: https://reviews.llvm.org/D70211
show more ...
|
|
Revision tags: llvmorg-9.0.0, llvmorg-9.0.0-rc6, llvmorg-9.0.0-rc5 |
|
| #
2bf8d774 |
| 10-Sep-2019 |
Dmitri Gribenko <[email protected]> |
Revert "Reland "r364412 [ExpandMemCmp][MergeICmps] Move passes out of CodeGen into opt pipeline.""
This reverts commit r371502, it broke tests (clang/test/CodeGenCXX/auto-var-init.cpp).
llvm-svn: 3
Revert "Reland "r364412 [ExpandMemCmp][MergeICmps] Move passes out of CodeGen into opt pipeline.""
This reverts commit r371502, it broke tests (clang/test/CodeGenCXX/auto-var-init.cpp).
llvm-svn: 371507
show more ...
|