|
Revision tags: 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 |
|
| #
3bc38fb2 |
| 04-Sep-2024 |
Nikita Popov <npopov@redhat.com> |
[InstCombine] Generalize and consolidate phi translation check (#106051)
The foldOpIntoPhi() transforms requires all operands to be
phi-translatable. This can be the case either because they are ph
[InstCombine] Generalize and consolidate phi translation check (#106051)
The foldOpIntoPhi() transforms requires all operands to be
phi-translatable. This can be the case either because they are phi nodes
in the same block, or because the operand dominates the block.
Currently, most callers of foldOpIntoPhi() satisfy this pre-condition by
requiring a constant operand, which trivially dominates everything. Only
selects had handling for variable operands.
Move this logic into foldOpIntoPhi(), so things are handled correctly if
other callers are generalized. Also make the implementation a bit more
general by querying the dominator tree.
show more ...
|
|
Revision tags: llvmorg-19.1.0-rc4 |
|
| #
4549a8d2 |
| 26-Aug-2024 |
Nikita Popov <npopov@redhat.com> |
[InstCombine] Add additional tests for select of phi transform (NFC)
Test coverage for the canSelectOperandBeMappingIntoPredBlock() logic.
|
|
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 |
|
| #
deab451e |
| 04-Jun-2024 |
Nikita Popov <npopov@redhat.com> |
[IR] Remove support for icmp and fcmp constant expressions (#93038)
Remove support for the icmp and fcmp constant expressions.
This is part of:
https://discourse.llvm.org/t/rfc-remove-most-const
[IR] Remove support for icmp and fcmp constant expressions (#93038)
Remove support for the icmp and fcmp constant expressions.
This is part of:
https://discourse.llvm.org/t/rfc-remove-most-constant-expressions/63179
As usual, many of the updated tests will no longer test what they were
originally intended to -- this is hard to preserve when constant
expressions get removed, and in many cases just impossible as the
existence of a specific kind of constant expression was the cause of the
issue in the first place.
show more ...
|
|
Revision tags: llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1 |
|
| #
6cdf596c |
| 06-Mar-2024 |
hanbeom <kese111@gmail.com> |
[InstCombine] If inst in unreachable refers to an inst change it to poison (#78444)
Instructions in unreachable basic blocks are removed, but terminators
are not. In this case, even instructions th
[InstCombine] If inst in unreachable refers to an inst change it to poison (#78444)
Instructions in unreachable basic blocks are removed, but terminators
are not. In this case, even instructions that are only referenced by
a terminator, such as a return instruction, cannot be processed
properly.
This patch changes the operand of a return instruction in an
unreachable basic block to poison if it refers to the instruction,
allowing the instruction to be properly processed.
Fixes #65107.
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, 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 |
|
| #
5d6dfba1 |
| 27-Feb-2023 |
Nikita Popov <npopov@redhat.com> |
[ConstExpr] Avoid creation of select constant expressions
These expressions will now only be created if explicitly requested in IR/bitcode (and by LowerTypeTests, which has a tricky to remove use).
[ConstExpr] Avoid creation of select constant expressions
These expressions will now only be created if explicitly requested in IR/bitcode (and by LowerTypeTests, which has a tricky to remove use).
This is in preparation for removing these expressions entirely, but also fixes #60983 in the meantime.
show more ...
|
|
Revision tags: 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, working, llvmorg-15.0.2 |
|
| #
779fd396 |
| 30-Sep-2022 |
Nikita Popov <npopov@redhat.com> |
Reapply [InstCombine] Switch foldOpIntoPhi() to use InstSimplify
Relative to the previous attempt, this is rebased over the InstSimplify fix in ac74e7a7806480a000c9a3502405c3dedd8810de, which addres
Reapply [InstCombine] Switch foldOpIntoPhi() to use InstSimplify
Relative to the previous attempt, this is rebased over the InstSimplify fix in ac74e7a7806480a000c9a3502405c3dedd8810de, which addresses the miscompile reported in PR58401.
-----
foldOpIntoPhi() currently only folds operations into the phi if all but one operands constant-fold. The two exceptions to this are freeze and select, where we allow more general simplification.
This patch makes foldOpIntoPhi() generally simplification based and removes all the instruction-specific logic. We just try to simplify the instruction for each operand, and for the (potentially) one non-simplified operand, we move it into the new block with adjusted operands.
This fixes https://github.com/llvm/llvm-project/issues/57448, which was my original motivation for the change.
Differential Revision: https://reviews.llvm.org/D134954
show more ...
|
| #
69939613 |
| 17-Oct-2022 |
Florian Hahn <flo@fhahn.com> |
Revert "Reapply [InstCombine] Switch foldOpIntoPhi() to use InstSimplify"
This reverts commit 333246b48ea4a70842e78c977cc92d365720465f.
It looks like this patch causes a mis-compile: https://github
Revert "Reapply [InstCombine] Switch foldOpIntoPhi() to use InstSimplify"
This reverts commit 333246b48ea4a70842e78c977cc92d365720465f.
It looks like this patch causes a mis-compile: https://github.com/llvm/llvm-project/issues/58401
Fixes #58401.
show more ...
|
| #
333246b4 |
| 30-Sep-2022 |
Nikita Popov <npopov@redhat.com> |
Reapply [InstCombine] Switch foldOpIntoPhi() to use InstSimplify
Relative to the previous attempt, this adjusts simplification to use the correct context instruction: We need to use the terminator o
Reapply [InstCombine] Switch foldOpIntoPhi() to use InstSimplify
Relative to the previous attempt, this adjusts simplification to use the correct context instruction: We need to use the terminator of the incoming block, not the original instruction.
-----
foldOpIntoPhi() currently only folds operations into the phi if all but one operands constant-fold. The two exceptions to this are freeze and select, where we allow more general simplification.
This patch makes foldOpIntoPhi() generally simplification based and removes all the instruction-specific logic. We just try to simplify the instruction for each operand, and for the (potentially) one non-simplified operand, we move it into the new block with adjusted operands.
This fixes https://github.com/llvm/llvm-project/issues/57448, which was my original motivation for the change.
Differential Revision: https://reviews.llvm.org/D134954
show more ...
|
| #
b9898e7e |
| 06-Oct-2022 |
Alina Sbirlea <asbirlea@google.com> |
Revert "Reapply [InstCombine] Switch foldOpIntoPhi() to use InstSimplify"
This reverts commit e94619b955104841cc2a4a6febe4025ee140194e.
|
| #
e94619b9 |
| 30-Sep-2022 |
Nikita Popov <npopov@redhat.com> |
Reapply [InstCombine] Switch foldOpIntoPhi() to use InstSimplify
The infinite loop seen on buildbots should be fixed by 11897708c0229c92802e747564e7c34b722f045f (assuming there are not multiple infi
Reapply [InstCombine] Switch foldOpIntoPhi() to use InstSimplify
The infinite loop seen on buildbots should be fixed by 11897708c0229c92802e747564e7c34b722f045f (assuming there are not multiple infinite combine loops...)
-----
foldOpIntoPhi() currently only folds operations into the phi if all but one operands constant-fold. The two exceptions to this are freeze and select, where we allow more general simplification.
This patch makes foldOpIntoPhi() generally simplification based and removes all the instruction-specific logic. We just try to simplify the instruction for each operand, and for the (potentially) one non-simplified operand, we move it into the new block with adjusted operands.
This fixes https://github.com/llvm/llvm-project/issues/57448, which was my original motivation for the change.
Differential Revision: https://reviews.llvm.org/D134954
show more ...
|
| #
d7592bbb |
| 04-Oct-2022 |
Gulfem Savrun Yeniceri <gulfem@google.com> |
Revert "Reapply [InstCombine] Switch foldOpIntoPhi() to use InstSimplify"
This reverts commit e1dd2cd063785ea3a6004c8d173f13113b1b8265 because the original commit b20e34b39f72f2be035dfb7367b6880fd2c
Revert "Reapply [InstCombine] Switch foldOpIntoPhi() to use InstSimplify"
This reverts commit e1dd2cd063785ea3a6004c8d173f13113b1b8265 because the original commit b20e34b39f72f2be035dfb7367b6880fd2cf213a had a dramatic increase in the build time of RTfuzzer, which caused Fuchsia Clang toolchain builders to timeout: https://luci-milo.appspot.com/ui/p/fuchsia/builders/toolchain.ci/clang-linux-x64/b8801248587754572961/overview
show more ...
|
| #
e1dd2cd0 |
| 30-Sep-2022 |
Nikita Popov <npopov@redhat.com> |
Reapply [InstCombine] Switch foldOpIntoPhi() to use InstSimplify
Reapply with a fix for the case where an operand simplified back to the original phi: We need to map this case to the new phi node.
Reapply [InstCombine] Switch foldOpIntoPhi() to use InstSimplify
Reapply with a fix for the case where an operand simplified back to the original phi: We need to map this case to the new phi node.
-----
foldOpIntoPhi() currently only folds operations into the phi if all but one operands constant-fold. The two exceptions to this are freeze and select, where we allow more general simplification.
This patch makes foldOpIntoPhi() generally simplification based and removes all the instruction-specific logic. We just try to simplify the instruction for each operand, and for the (potentially) one non-simplified operand, we move it into the new block with adjusted operands.
This fixes https://github.com/llvm/llvm-project/issues/57448, which was my original motivation for the change.
show more ...
|
| #
0f32f0e1 |
| 04-Oct-2022 |
Nikita Popov <npopov@redhat.com> |
Revert "[InstCombine] Switch foldOpIntoPhi() to use InstSimplify"
This reverts commit b20e34b39f72f2be035dfb7367b6880fd2cf213a.
This causes RAUW type mismatch assertions on some buildbots, revertin
Revert "[InstCombine] Switch foldOpIntoPhi() to use InstSimplify"
This reverts commit b20e34b39f72f2be035dfb7367b6880fd2cf213a.
This causes RAUW type mismatch assertions on some buildbots, reverting for now.
show more ...
|
| #
b20e34b3 |
| 30-Sep-2022 |
Nikita Popov <npopov@redhat.com> |
[InstCombine] Switch foldOpIntoPhi() to use InstSimplify
foldOpIntoPhi() currently only folds operations into the phi if all but one operands constant-fold. The two exceptions to this are freeze and
[InstCombine] Switch foldOpIntoPhi() to use InstSimplify
foldOpIntoPhi() currently only folds operations into the phi if all but one operands constant-fold. The two exceptions to this are freeze and select, where we allow more general simplification.
This patch makes foldOpIntoPhi() generally simplification based and removes all the instruction-specific logic. We just try to simplify the instruction for each operand, and for the (potentially) one non-simplified operand, we move it into the new block with adjusted operands.
This fixes https://github.com/llvm/llvm-project/issues/57448, which was my original motivation for the change.
show more ...
|
| #
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 ...
|
| #
c720fad1 |
| 30-Sep-2022 |
Nikita Popov <npopov@redhat.com> |
[InstCombine] Add test for phi translation during select of phi fold (NFC)
The phi translation performed during this fold is important for correctness, but was apparently untested.
|
|
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, llvmorg-14.0.0-rc1 |
|
| #
acdc419c |
| 04-Feb-2022 |
Bjorn Pettersson <bjorn.a.pettersson@ericsson.com> |
[test] Use -passes=instcombine instead of -instcombine in lots of tests. NFC
Another step moving away from the deprecated syntax of specifying pass pipeline in opt.
Differential Revision: https://r
[test] Use -passes=instcombine instead of -instcombine in lots of tests. NFC
Another step moving away from the deprecated syntax of specifying pass pipeline in opt.
Differential Revision: https://reviews.llvm.org/D119081
show more ...
|
|
Revision tags: 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, llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2, llvmorg-13.0.0-rc1, llvmorg-14-init, llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3, llvmorg-12.0.1-rc2, llvmorg-12.0.1-rc1, llvmorg-12.0.0, llvmorg-12.0.0-rc5, llvmorg-12.0.0-rc4, llvmorg-12.0.0-rc3, llvmorg-12.0.0-rc2, 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, llvmorg-11.0.1, llvmorg-11.0.1-rc2 |
|
| #
4f051fe3 |
| 10-Dec-2020 |
Sanjay Patel <spatel@rotateright.com> |
[InstCombine] avoid crash sinking to unreachable block
The test is reduced from the example in D82005.
Similar to 94f6d365e, the test here would assert in the DomTree when we tried to convert a sel
[InstCombine] avoid crash sinking to unreachable block
The test is reduced from the example in D82005.
Similar to 94f6d365e, the test here would assert in the DomTree when we tried to convert a select to a phi with an unreachable block operand.
We may want to add some kind of guard code in DomTree itself to avoid this sort of problem.
show more ...
|
| #
94f6d365 |
| 05-Dec-2020 |
Sanjay Patel <spatel@rotateright.com> |
[InstCombine] avoid crash on phi with unreachable incoming block (PR48369)
|
|
Revision tags: llvmorg-11.0.1-rc1, 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, llvmorg-9.0.0, llvmorg-9.0.0-rc6, llvmorg-9.0.0-rc5, llvmorg-9.0.0-rc4, llvmorg-9.0.0-rc3, llvmorg-9.0.0-rc2, llvmorg-9.0.0-rc1, llvmorg-10-init, llvmorg-8.0.1, llvmorg-8.0.1-rc4, llvmorg-8.0.1-rc3, llvmorg-8.0.1-rc2, llvmorg-8.0.1-rc1 |
|
| #
cee313d2 |
| 17-Apr-2019 |
Eric Christopher <echristo@gmail.com> |
Revert "Temporarily Revert "Add basic loop fusion pass.""
The reversion apparently deleted the test/Transforms directory.
Will be re-reverting again.
llvm-svn: 358552
|
| #
b276dd19 |
| 31-Mar-2019 |
Sanjay Patel <spatel@rotateright.com> |
[InstCombine] canonicalize select shuffles by commuting
In PR41304: https://bugs.llvm.org/show_bug.cgi?id=41304 ...we have a case where we want to fold a binop of select-shuffle (blended) values.
R
[InstCombine] canonicalize select shuffles by commuting
In PR41304: https://bugs.llvm.org/show_bug.cgi?id=41304 ...we have a case where we want to fold a binop of select-shuffle (blended) values.
Rather than try to match commuted variants of the pattern, we can canonicalize the shuffles and check for mask equality with commuted operands.
We don't produce arbitrary shuffle masks in instcombine, but select-shuffles are a special case that the backend is required to handle because we already canonicalize vector select to this shuffle form.
So there should be no codegen difference from this change. It's possible that this improves CSE in IR though.
Differential Revision: https://reviews.llvm.org/D60016
llvm-svn: 357366
show more ...
|
| #
01c07b1a |
| 29-Mar-2019 |
Sanjay Patel <spatel@rotateright.com> |
[InstCombine] autogenerate complete checks; NFC
llvm-svn: 357291
|
|
Revision tags: llvmorg-8.0.0, llvmorg-8.0.0-rc5, llvmorg-8.0.0-rc4, llvmorg-8.0.0-rc3, llvmorg-7.1.0, llvmorg-7.1.0-rc1, llvmorg-8.0.0-rc2, llvmorg-8.0.0-rc1, llvmorg-7.0.1, llvmorg-7.0.1-rc3, llvmorg-7.0.1-rc2, llvmorg-7.0.1-rc1, llvmorg-7.0.0, llvmorg-7.0.0-rc3, llvmorg-7.0.0-rc2, llvmorg-7.0.0-rc1, llvmorg-6.0.1, llvmorg-6.0.1-rc3, llvmorg-6.0.1-rc2, llvmorg-6.0.1-rc1, llvmorg-5.0.2, llvmorg-5.0.2-rc2, llvmorg-5.0.2-rc1, llvmorg-6.0.0, llvmorg-6.0.0-rc3, llvmorg-6.0.0-rc2, llvmorg-6.0.0-rc1, llvmorg-5.0.1, llvmorg-5.0.1-rc3, llvmorg-5.0.1-rc2 |
|
| #
90e4f719 |
| 13-Nov-2017 |
Matt Arsenault <Matthew.Arsenault@amd.com> |
Fix some misc. -enable-var-scope violations
llvm-svn: 318006
|
|
Revision tags: llvmorg-5.0.1-rc1, llvmorg-5.0.0, llvmorg-5.0.0-rc5, llvmorg-5.0.0-rc4, llvmorg-5.0.0-rc3, llvmorg-5.0.0-rc2, llvmorg-5.0.0-rc1 |
|
| #
6bc14c65 |
| 16-Jun-2017 |
Anna Thomas <anna@azul.com> |
[InstCombine] Set correct insertion point for selects generated while folding phis
Summary: When we fold vector constants that are operands of phi's that feed into select, we need to set the correct
[InstCombine] Set correct insertion point for selects generated while folding phis
Summary: When we fold vector constants that are operands of phi's that feed into select, we need to set the correct insertion point for the *new* selects that get generated. The correct insertion point is the incoming block for the phi. Such cases can occur with patch r298845, which fixed folding of vector constants, but the new selects could be inserted incorrectly (as the added test case shows).
Reviewers: majnemer, spatel, sanjoy
Reviewed by: spatel
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D34162
llvm-svn: 305591
show more ...
|
|
Revision tags: llvmorg-4.0.1, llvmorg-4.0.1-rc3, llvmorg-4.0.1-rc2, llvmorg-4.0.1-rc1 |
|
| #
ba04f4e9 |
| 28-Mar-2017 |
Anna Thomas <anna@azul.com> |
rename instcombine test file. NFC
llvm-svn: 298904
|