diff options
author | Nikita Popov <npopov@redhat.com> | 2022-09-30 12:13:40 +0200 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2022-10-17 16:11:05 +0200 |
commit | 779fd3968412dd2c8b75a0f5884d39bd5ba29bfd (patch) | |
tree | 32547c755e1307b30b4e9532b6719b8111f3850d /clang/lib/Basic/Module.cpp | |
parent | efd0d6626943d0a9eef638961915ab37bee9ef87 (diff) | |
download | llvm-779fd3968412dd2c8b75a0f5884d39bd5ba29bfd.zip llvm-779fd3968412dd2c8b75a0f5884d39bd5ba29bfd.tar.gz llvm-779fd3968412dd2c8b75a0f5884d39bd5ba29bfd.tar.bz2 |
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
Diffstat (limited to 'clang/lib/Basic/Module.cpp')
0 files changed, 0 insertions, 0 deletions