[llvm-bugs] [Bug 37278] New: Devirtualization optimization missed

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Apr 27 20:20:04 PDT 2018


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

            Bug ID: 37278
           Summary: Devirtualization optimization missed
           Product: clang
           Version: 6.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: marcosatti at gmail.com
                CC: llvm-bugs at lists.llvm.org

The compiler misses this opportunity to perform devirtualization on the
offset/read_uword/write_uword member functions:

https://godbolt.org/g/P4nfyr

The only compiler to optimize this correctly was GCC where it never calls these
member functions and just uses a register to store the result.

Moving the offset member function directly into the WordPcRegister class makes
the compiler perform the same optimization as GCC.

Marking the WordPcRegister as final or not doesn't seem to make a difference
either.

-- 
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/20180428/5c27299c/attachment.html>


More information about the llvm-bugs mailing list