[llvm] [ValueTracking][InstCombine] Fold add/or/xor to disjoint or using assume(no common bits) (PR #223344)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 13:47:02 PDT 2026


================
@@ -5516,6 +5516,17 @@ Instruction *InstCombinerImpl::visitXor(BinaryOperator &I) {
   if (Instruction *Xor = visitMaskedMerge(I, Builder))
     return Xor;
 
+  WithCache<const Value *> Op0Cache(Op0), Op1Cache(Op1);
----------------
nikic wrote:

This seems like two unrelated changes? One is the assume handling, and the other is xor -> disjoint or fold. These should be separated.

If we want to do the latter, it should probably be part of demanded bits simplification, which already computes known bits.

https://github.com/llvm/llvm-project/pull/223344


More information about the llvm-commits mailing list