https://bugs.llvm.org/show_bug.cgi?id=44427

            Bug ID: 44427
           Summary: [InstCombine] sub (and %x, -16), %x -> 0-(and %x, 15)
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

Looks like missed canonicalization to me. Not sure how much matters overall.

Name: sub (and %x, -16), %x -> 0-(and %x, 15)
Pre: isPowerOf2OrZero(-C1)
  %o = and i64 %x, C1
  %r = sub i64 %o, %x
=>
  %n = and i64 %x, (-C1-1)
  %r = sub i64 0, %n

https://rise4fun.com/Alive/t0hD
https://godbolt.org/z/R_RMfM

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to