[llvm-bugs] [Bug 26450] ARM code runs 2x slower compared to gcc
via llvm-bugs
llvm-bugs at lists.llvm.org
Wed Feb 3 06:34:53 PST 2016
https://llvm.org/bugs/show_bug.cgi?id=26450
James Molloy <james.molloy at arm.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |INVALID
--- Comment #5 from James Molloy <james.molloy at arm.com> ---
Hi,
OK, there's two things here:
Firstly, it seems __umodsi3 and friends are significantly slower than
__aeabi_idivmod. GCC is generating __aeabi_idivmod - perhaps we should? We
select __modsi3 unless the target is EABI or Android - I suspect that should be
EABI, Android or GNUEABI.
GCC 4.9: 1.24s
Clang 3.7: 3.48s
Clang 3.7 (using __aeabi_idivmod): 1.15s
Secondly, you're not specifying a CPU. That's why your division is going out to
the library. Unless you're on a Cortex-A9, you'll have hardware division. Use
-mcpu to enable it.
GCC 4.9 with -mcpu=cortex-a15: 276ms
Clang 3.7 with -mcpu=cortex-a15: 258ms
(I had to switch to using perf stat's task-clock metric because time elapsed
was getting too noisy)
By the way: "I've just discovered how immature LLVM/Clang was on ARM." (from
https://users.rust-lang.org/t/executable-size-and-performance-vs-c/4496/34)
That's a little over the top - the ARM backend is around 10 years old now, it's
fairly mature.
James
--
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/20160203/159f1783/attachment.html>
More information about the llvm-bugs
mailing list