[llvm] [InstCombine] Fold `select Cond, not X, X` into `Cond ^ X` (PR #90089)
via llvm-commits
llvm-commits at lists.llvm.org
Mon May 13 09:22:56 PDT 2024
================
@@ -3985,5 +3985,10 @@ Instruction *InstCombinerImpl::visitSelectInst(SelectInst &SI) {
}
}
+ if (CondVal->getType() == SI.getType() && impliesPoison(FalseVal, TrueVal) &&
+ isImpliedCondition(FalseVal, TrueVal, DL, /*LHSIsTrue=*/true) == false &&
+ isImpliedCondition(FalseVal, TrueVal, DL, /*LHSIsTrue=*/false) == true)
----------------
goldsteinn wrote:
Maybe add a comment that the inverse case doesn't naturally occur in code to avoid people re-testing / re-submitting.
https://github.com/llvm/llvm-project/pull/90089
More information about the llvm-commits
mailing list