[llvm] Fixies missed optimization (x + y) & (2^C) -> x & 2^C when y % 2^(C+1) == 0 (PR #157072)
    Yingwei Zheng via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Sun Sep  7 07:30:08 PDT 2025
    
    
  
================
@@ -956,10 +955,7 @@ define i32 @and_add_shl_vscale_not_power2_negative() vscale_range(1,16) {
 ; Negative test: the %sign may be 0, https://alive2.llvm.org/ce/z/WU_j4a
 define i32 @and_add_and (i32 %x) {
 ; CHECK-LABEL: @and_add_and(
-; CHECK-NEXT:    [[TMP1:%.*]] = shl i32 [[X:%.*]], 24
-; CHECK-NEXT:    [[TMP2:%.*]] = and i32 [[TMP1]], -2147483648
-; CHECK-NEXT:    [[AND:%.*]] = xor i32 [[TMP2]], -2147483648
-; CHECK-NEXT:    ret i32 [[AND]]
+; CHECK-NEXT:    ret i32 0
----------------
dtcxzyw wrote:
It is incorrect: https://alive2.llvm.org/ce/z/Bsn7-J
https://github.com/llvm/llvm-project/pull/157072
    
    
More information about the llvm-commits
mailing list