[llvm] [InstCombine] Fold `(icmp eq/ne (xor x, y), C1)` even if multiuse (PR #87275)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 7 11:40:24 PDT 2024


================
@@ -455,7 +455,7 @@ define i1 @icmp_or_xor_2_4_fail(i64 %x1, i64 %y1, i64 %x2, i64 %y2) {
 ; CHECK-NEXT:    [[XOR1:%.*]] = xor i64 [[X2:%.*]], [[Y2:%.*]]
 ; CHECK-NEXT:    [[OR:%.*]] = or i64 [[XOR]], [[XOR1]]
 ; CHECK-NEXT:    [[CMP:%.*]] = icmp eq i64 [[OR]], 0
-; CHECK-NEXT:    [[CMP_1:%.*]] = icmp eq i64 [[XOR1]], 0
+; CHECK-NEXT:    [[CMP_1:%.*]] = icmp eq i64 [[X2]], [[Y2]]
----------------
goldsteinn wrote:

Yeah its the creation of new one use. I added a comment explaining.
Think handling in `handleUseCountDecrement()` requires pretty deep adding. Doubt its worth it. Esp when we run InstCombine multiple times in the real pipeline.

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


More information about the llvm-commits mailing list