Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow division on ARM Linux/GNU #39266

Closed
MagaTailor opened this issue Jan 24, 2017 · 8 comments
Closed

Slow division on ARM Linux/GNU #39266

MagaTailor opened this issue Jan 24, 2017 · 8 comments
Labels
I-slow Issue: Problems and improvements with respect to performance of generated code. O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state

Comments

@MagaTailor
Copy link

The amicable numbers benchmark is slow on ARM again.

With a properly patched LLVM it used to perform like this:

samples  %        linenr info                 image name               symbol name
22510    85.9652  (no location information)   libgcc_s.so.1            /lib/arm-linux-gnueabihf/libgcc_s.so.1
3552     13.5650  amicable.rs:18              amicable.old             $a.0
99        0.3781  (no location information)   no-vmlinux               /no-vmlinux
3         0.0115  (no location information)   ld-2.19.so               .udivsi3_skip_div0_test
3         0.0115  dl-lookup.c:82              ld-2.19.so               do_lookup_x

whereas now, it's slow again:

samples  %        linenr info                 image name               symbol name
14943    32.5989  (no location information)   amicable                 __udivmodsi4
13260    28.9273  (no location information)   amicable                 __divmodsi4
9504     20.7334  (no location information)   amicable                 __aeabi_idivmod
7993     17.4371  amicable.rs:18              amicable                 $a.0
118       0.2574  (no location information)   no-vmlinux               /no-vmlinux
5         0.0109  dl-reloc.c:154              ld-2.19.so               _dl_relocate_object
3         0.0065  dl-lookup.c:82              ld-2.19.so               do_lookup_x

LLVM doesn't need patching anymore so it must have been the compiler-rt removal, etc.

@est31
Copy link
Member

est31 commented Jan 24, 2017

so it must have been the compiler-rt removal, etc.

Just noting, compiler-rt is not removed yet, its only "crate-ified", so that its build system uses a build.rs now. But its still compiling the source files of the original compiler-rt.

@parched
Copy link
Contributor

parched commented Jan 24, 2017

@MagaTailor which arm target are you testing? And which two compiler versions?

@MagaTailor
Copy link
Author

llvm.org/viewvc/llvm-project?view=revision&revision=259657

@MagaTailor
Copy link
Author

I have no idea if it ever worked for any officially distributed builds and the earliest broken build of mine still lying around is dated 16eeeac78 2016-10-18. IIRC, LLVM 3.9 did include that patch so the issue should have gone away.

Anyone wishing to find out can use this build as a working baseline.

@sanxiyn sanxiyn added I-slow Issue: Problems and improvements with respect to performance of generated code. O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state labels Feb 14, 2017
@MagaTailor
Copy link
Author

The issue is not present in clang 4.0 so it's definitely another rust fuckup.

@MagaTailor MagaTailor changed the title Back to slow division on ARM Slow division on ARM May 6, 2017
@parched
Copy link
Contributor

parched commented May 11, 2017

Hi @MagaTailor, if you can provide some more details on how reproduce this, I will investigate. Can you give both the C code and Rust code you are comparing, along with the exact compiler switches you are using and what target you are testing on?

@MagaTailor
Copy link
Author

@parched
Copy link
Contributor

parched commented May 11, 2017

Thanks, and what compiler switches and what target?

@MagaTailor MagaTailor changed the title Slow division on ARM Slow division on ARM Linux/GNU May 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-slow Issue: Problems and improvements with respect to performance of generated code. O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state
Projects
None yet
Development

No branches or pull requests

4 participants