[Bug 1170376] New: Enable -moutline-atomics flag for GCC in Tumbleweed
http://bugzilla.opensuse.org/show_bug.cgi?id=1170376 Bug ID: 1170376 Summary: Enable -moutline-atomics flag for GCC in Tumbleweed Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: aarch64 OS: Linux Status: NEW Severity: Normal Priority: P5 - None Component: Other Assignee: screening-team-bugs@suse.de Reporter: guillaume.gardet@arm.com QA Contact: qa-bugs@suse.de CC: afaerber@suse.com, dleuenberger@suse.com, dmueller@suse.com Found By: --- Blocker: --- GCC 10 and GCC 9.3.1+ support '-moutline-atomics' [0], so we could enable this flag in Tumbleweed to improve LSE atomic operations on armv8.1+ hardware, with very small overhead for armv8.0 hardware. The problem is llvm does not support this flag and returns an error if used: clang-10.0: error: unknown argument: '-moutline-atomics' The problem is optflags in Tumbleweed PrjConf targets both GCC and LLVM, so adding '-moutline-atomics' would break LLVM builds. I can see few solutions: 1) Enable '-moutline-atomics' by default in GCC packages [1] 2) Add '-moutline-atomics' to the list of ignored flags in LLVM 3) Split optflags to optflags_common, optflags_gcc and optflags_llvm [0]: https://gcc.gnu.org/onlinedocs/gcc/AArch64-Options.html#AArch64-Options [1]: https://gcc.gnu.org/legacy-ml/gcc-patches/2019-09/msg01035.html -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1170376 http://bugzilla.opensuse.org/show_bug.cgi?id=1170376#c1 Dirk Mueller <dmueller@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|screening-team-bugs@suse.de |aaronpuchert@alice-dsl.net --- Comment #1 from Dirk Mueller <dmueller@suse.com> --- I have difficulties imaging 3) to work, because we'd have to patch everything to use optflags_llvm if and only if clang is called, which is very intensive. the patch in 1) didn't land upstream, right? so thats also not nice. It seems like 2) is the only option. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1170376 Dirk Mueller <dmueller@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |matz@suse.com -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1170376 Dirk Mueller <dmueller@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rguenther@suse.com -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1170376 http://bugzilla.opensuse.org/show_bug.cgi?id=1170376#c2 --- Comment #2 from Aaron Puchert <aaronpuchert@alice-dsl.net> --- (In reply to Guillaume GARDET from comment #0)
2) Add '-moutline-atomics' to the list of ignored flags in LLVM
(In reply to Dirk Mueller from comment #1)
It seems like 2) is the only option.
Wouldn't be the first time we're doing this so it's fine for me. [1] Another option would be to remove it manually in the affected packages, I think there are few packages that build with Clang. But it's probably not a bad idea to go with 2) either way so that Clang supports our default flags. Silly question: why can this behavior not be achieved with -mtune=armv8.1-a? [1] https://build.opensuse.org/package/view_file/devel:tools:compiler/llvm10/cla... -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1170376 http://bugzilla.opensuse.org/show_bug.cgi?id=1170376#c4 --- Comment #4 from Guillaume GARDET <guillaume.gardet@arm.com> --- (In reply to Aaron Puchert from comment #2)
(In reply to Guillaume GARDET from comment #0)
2) Add '-moutline-atomics' to the list of ignored flags in LLVM
(In reply to Dirk Mueller from comment #1)
It seems like 2) is the only option.
Wouldn't be the first time we're doing this so it's fine for me. [1]
Another option would be to remove it manually in the affected packages, I think there are few packages that build with Clang. But it's probably not a bad idea to go with 2) either way so that Clang supports our default flags.
So, going with 2) seems to be ok for everyone!
Silly question: why can this behavior not be achieved with -mtune=armv8.1-a?
AFAIK, '-mtune=armv8.1-a' does not exist, and '-march=armv8.1-a' would break all armv8.0 hardware as it will use instructions only available on v8.1, including LSE atomics. '-moutline-atomics' will make use of new LSE instructions only if hardware support it, and will fallback to legacy instructions if hardware does not support the new ones. @Aaron, would you take care of the patches or should I prepare a SR? -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1170376 http://bugzilla.opensuse.org/show_bug.cgi?id=1170376#c7 --- Comment #7 from Guillaume GARDET <guillaume.gardet@arm.com> --- GCC 10.1 will enbale '-moutline-atomics' by default. Commit: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=cd4b68527988f42c10c0d6c10e812d... -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1170376 http://bugzilla.opensuse.org/show_bug.cgi?id=1170376#c8 Aaron Puchert <aaronpuchert@alice-dsl.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |guillaume.gardet@arm.com Flags| |needinfo?(guillaume.gardet@ | |arm.com) --- Comment #8 from Aaron Puchert <aaronpuchert@alice-dsl.net> --- (In reply to Michael Matz from comment #6)
But there's a slight difference to traditional mtune behaviour: in this case there are calls to external routines inserted, not just some slight preferences in using (say) shl x,1 vs. an add x,x instructions. That makes sense indeed, it's a bit different.
(In reply to Guillaume GARDET from comment #7)
GCC 10.1 will enbale '-moutline-atomics' by default. So we don't need to explicitly enable the flag, and I don't need to patch Clang to ignore it, right?
-- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1170376 http://bugzilla.opensuse.org/show_bug.cgi?id=1170376#c9 Guillaume GARDET <guillaume.gardet@arm.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Flags|needinfo?(guillaume.gardet@ | |arm.com) | --- Comment #9 from Guillaume GARDET <guillaume.gardet@arm.com> ---
(In reply to Guillaume GARDET from comment #7)
GCC 10.1 will enbale '-moutline-atomics' by default. So we don't need to explicitly enable the flag, and I don't need to patch Clang to ignore it, right?
GCC10 should land in Tumbleweed as default GCC in few weeks from now, so no need to patch anything for Tumbleweed. We could revisit this if we want to enable '-moutline-atomics' for SLE or Leap, later. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1170376 http://bugzilla.opensuse.org/show_bug.cgi?id=1170376#c10 Dirk Mueller <dmueller@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |UPSTREAM --- Comment #10 from Dirk Mueller <dmueller@suse.com> --- fixed upstream by flipping the default in GCC -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com