[PATCH] D82072: [InstCombine] Combine select & Phi by same condition
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 24 00:29:58 PDT 2020
nikic accepted this revision.
nikic added a comment.
This revision is now accepted and ready to land.
LGTM with test additions.
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp:2486
if (auto *Insn = dyn_cast<Instruction>(Inputs[Pred]))
if (!DT.dominates(Insn, Pred->getTerminator()))
return nullptr;
----------------
nikic wrote:
> We should add `&& Insn != Pred->getTerminator()` here to make the `@test_invoke_2_neg` test case work. What we really want to express is that `DT.dominates(Insn, Incoming)`, but as there is no `dominates(Instruction *, BasicBlockEdge)` API, this would be the closest replacement. (We could also add that API of course).
Actually, let's leave this to a separate patch. We should really do this via a DominatorTree API that can distinguish normal&unwind edges properly.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82072/new/
https://reviews.llvm.org/D82072
More information about the llvm-commits
mailing list