[llvm-bugs] [Bug 51551] New: Missed optimization for (X * odd number) & 1

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Aug 19 15:16:00 PDT 2021


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

            Bug ID: 51551
           Summary: Missed optimization for (X * odd number) & 1
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: david.bolvansky at gmail.com
                CC: llvm-bugs at lists.llvm.org

----------------------------------------
define i1 @src(i32 %0, i32 %1) {
%2:
  %3 = and i32 %1, 1
  %4 = icmp ne i32 %3, 0
  assume i1 %4
  %5 = mul i32 %1, %0
  %6 = and i32 %5, 1
  %7 = icmp eq i32 %6, 0
  ret i1 %7
}
=>
define i1 @tgt(i32 %0, i32 %1) {
%2:
  %3 = and i32 %0, 1
  %4 = icmp eq i32 %3, 0
  ret i1 %4
}
Transformation seems to be correct!

https://godbolt.org/z/eee8ETo4h

-- 
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/20210819/0f22bde1/attachment.html>


More information about the llvm-bugs mailing list