[llvm] [InstCombine] Fold operation into select, when one operand is zext of select's condition (PR #166816)
Andreas Jonson via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 7 06:54:56 PST 2025
================
@@ -1758,6 +1758,9 @@ static Value *simplifyOperationIntoSelectOperand(Instruction &I, SelectInst *SI,
m_Specific(Op), m_Value(V))) &&
isGuaranteedNotToBeUndefOrPoison(V)) {
// Pass
+ } else if (match(Op, m_ZExt(m_Specific(SI->getCondition())))) {
----------------
andjo403 wrote:
I do not think that it is any case that can happen if the operand is a i1 the select result is also a i1 and will be folded away and it can not be a trunc as it is not possible to trunc a i1
https://github.com/llvm/llvm-project/pull/166816
More information about the llvm-commits
mailing list