[PATCH] D82005: [InstCombine] Replace selects with Phis
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 18 13:39:11 PDT 2020
efriedma added a comment.
I think this makes sense as a canonicalization: if we could express a select idiom using either a PHI or a select, the PHI probably makes sense as the canonical form. We clearly wouldn't want to canonicalize the other way. (The more general discussion of select vs. control flow is more centered around whether we should have the control flow in the first place; that's outside the scope of instcombine.)
The test coverage here seems a little slim; I'd like to see more coverage for interesting cases (in particular, cases where the PHI node doesn't have exactly two incoming edges).
We could try to generalize this transform to try to insert the PHI in blocks other than the block that contains the select; maybe leave that as a followup, though.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82005/new/
https://reviews.llvm.org/D82005
More information about the llvm-commits
mailing list