-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
[CodeGen][ARM] Missed optimizated load store pair instruction combine #133048
Comments
@llvm/issue-subscribers-backend-arm Author: None (hstk30-hw)
https://godbolt.org/z/db17KEWK1
GCC output:
llvm output:
ARMLoadStoreOptimizer Pass have Pre/post register allocation |
GCC might be defaulting to -mthumb, which would allow it to use STRD on llvm: https://godbolt.org/z/cfKzYnPfh. Otherwise the A32 instruction requires consecutive registers so it more difficult to use. |
GCC after 9.3.0 default to -mthumb possibly. In 8.5.0 can still use STRD. |
Hi, why llvm generate
I see the STRD need consecutive registers. Thumb not have this limit? I can't find thumb's document. |
The immediate version has T1 and A1 versions: https://developer.arm.com/documentation/ddi0406/c/Application-Level-Architecture/Instruction-Details/Alphabetical-list-of-instructions/STRD--immediate- Yeah - the arm instruction needs consecutive instructions, the thumb variant does not. The register allocator does not know that it is beneficial to duplicate the mov to make use of the strd instruction. Have you considered using -mthumb? Or is there a reason you cannot use it? The extra code-density itself can be good benefit. We should maybe be considering changing the default to -mthumb to match GCC. |
Emm, I can use -mthumb, but not sure how the performance. |
Note it is not GCC defaults that change but rather godbolt's configuration of gcc that changed between the versions. |
Thanks for the correction.
|
https://godbolt.org/z/db17KEWK1
GCC output:
llvm output:
ARMLoadStoreOptimizer Pass have Pre/post register allocation
The text was updated successfully, but these errors were encountered: