[llvm] [InstCombine] Reassociate xor and disjoint or through zext (PR #214970)

Joyoungjin via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 11 00:10:49 PDT 2026


================
@@ -435,12 +435,19 @@ static bool simplifyAssocCastAssoc(BinaryOperator *BinOp1,
   if (!BinOp2 || !BinOp2->hasOneUse())
     return false;
 
-  // `or disjoint` is equivalent to xor.
----------------
hunterhhunter wrote:

I added the logic to handle both forms without first verifying whether SimplifyAssociativeOrCommutative canonicalizes the commuted form before reaching this point. I'll check whether that branch is actually reachable and either remove it or add a test that exercises it.

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


More information about the llvm-commits mailing list