[all-commits] [llvm/llvm-project] e1dd2c: Reapply [InstCombine] Switch foldOpIntoPhi() to us...
Nikita Popov via All-commits
all-commits at lists.llvm.org
Tue Oct 4 06:18:55 PDT 2022
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: e1dd2cd063785ea3a6004c8d173f13113b1b8265
https://github.com/llvm/llvm-project/commit/e1dd2cd063785ea3a6004c8d173f13113b1b8265
Author: Nikita Popov <npopov at redhat.com>
Date: 2022-10-04 (Tue, 04 Oct 2022)
Changed paths:
M llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
M llvm/test/Transforms/InstCombine/intptr1.ll
M llvm/test/Transforms/InstCombine/intptr4.ll
M llvm/test/Transforms/InstCombine/intptr5.ll
M llvm/test/Transforms/InstCombine/intptr7.ll
M llvm/test/Transforms/InstCombine/phi-select-constant.ll
M llvm/test/Transforms/InstCombine/phi.ll
M llvm/test/Transforms/InstCombine/recurrence.ll
Log Message:
-----------
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.
More information about the All-commits
mailing list