https://bugs.llvm.org/show_bug.cgi?id=45480
Bug ID: 45480
Summary: clang fails to recognize popcount corresponding as
best as possible to detectPopcountIdiom example
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Scalar Optimizations
Assignee: unassignedb...@nondot.org
Reporter: gabrav...@gmail.com
CC: llvm-bugs@lists.llvm.org
Created attachment 23335
--> https://bugs.llvm.org/attachment.cgi?id=23335&action=edit
Contains relevant .{S,bc} files from both gcc and clang along with C source
code
I found the code at
https://github.com/llvm-mirror/llvm/blob/2c4ca6832fa6b306ee6a7010bfb80a3f2596f824/lib/Transforms/Scalar/LoopIdiomRecognize.cpp#L1260-L1283
interesting and wanted to reproduce an example of what LLVM reproduces at the
most very basic level. LLVM, however, fails to optimize such a reproduction to
an `llvm.ctpop` call.
GCC, however, manages to optimize it properly to a `__builtin_popcount` call
internally.
See https://godbolt.org/z/Sge8tQ for a direct comparison, I have also added an
attachment archive with relevant source/assembly/bytecode files.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs