[llvm-bugs] [Bug 45510] New: Failure to optimize certain kind of always-true comparisons

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Apr 12 21:22:18 PDT 2020


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

            Bug ID: 45510
           Summary: Failure to optimize certain kind of always-true
                    comparisons
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: gabravier at gmail.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 23342
  --> https://bugs.llvm.org/attachment.cgi?id=23342&action=edit
Contains files helping to reproduce the bug (not very helpful if you don't have
a development version of gcc)

Operations such as `x >= y || x == UINT_MAX` are not converted to `x >= y` by
LLVM, where GCC does as such.

Comparison here: https://godbolt.org/z/4-cyjG

I have attached an comparison archive, though it is not very useful right now
as the optimization hasn't made it into a GCC release yet (if you want, I can
add an updated archive once gcc 10.1 is released). The Godbolt comparison
better helps visualise the difference between GCC and clang here.

Notes:
- The archive's gcc.s file does not contain the optimizations. This is because
these optimizations are from gcc 10.0 (pre-release branch), and gcc.s was
generated with gcc 9.3. However, I would expect gcc >= 10.1 to have this
optimization.

-- 
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/20200413/872073c1/attachment.html>


More information about the llvm-bugs mailing list