[llvm] [InstCombine] Improve `(icmp pred (and X, Y), ...)` fold. (PR #66787)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 17 22:00:28 PST 2023
================
@@ -4410,6 +4410,11 @@ Instruction *InstCombinerImpl::foldNot(BinaryOperator &I) {
if (Instruction *NewXor = foldNotXor(I, Builder))
return NewXor;
+ // TODO: Could handle multi-use better by checking if all uses of NotOp (other
+ // than I) can be inverted.
+ if (Value *R = getFreeInverted(NotOp, NotOp->hasOneUse(), &Builder))
+ return replaceInstUsesWith(I, R);
----------------
goldsteinn wrote:
Some tests still rely on it, but did't poke around that deeply.
https://github.com/llvm/llvm-project/pull/66787
More information about the llvm-commits
mailing list