[llvm-bugs] [Bug 40493] New: Fold "(12 * unsigned) % 8 == 0" ->"(unsigned & 1) == 0" missing
    via llvm-bugs 
    llvm-bugs at lists.llvm.org
       
    Mon Jan 28 02:29:53 PST 2019
    
    
  
https://bugs.llvm.org/show_bug.cgi?id=40493
            Bug ID: 40493
           Summary: Fold "(12 * unsigned) % 8 == 0" ->"(unsigned & 1) ==
                    0" missing
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: lebedev.ri at gmail.com
                CC: llvm-bugs at lists.llvm.org
Not sure how general this can be though.
https://godbolt.org/z/9bNnlb
https://rise4fun.com/Alive/O8a
  %mul = mul i32 %area, 12
  %rem = and i32 %mul, 4
  %cmp = icmp eq i32 %rem, 0
=>
  %and = and i32 %area, 1
  %cmp = icmp eq i32 %and, 0
-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190128/7cbc6c79/attachment.html>
    
    
More information about the llvm-bugs
mailing list