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

LLVM-12 compilation error #57

Open
r-barnes opened this issue Sep 29, 2021 · 9 comments
Open

LLVM-12 compilation error #57

r-barnes opened this issue Sep 29, 2021 · 9 comments

Comments

@r-barnes
Copy link

When compiling with LLVM-12, I see:

armv8.h:32:1: error: 'gnu_inline' attribute without 'extern' in C++ treated as externally available, this changed in Clang 10 [-Werror,-Wgnu-inline-cpp-without-extern]
_NEON2SSE_INLINE int32x4_t vmull_high_s16(int16x8_t a, int16x8_t b) { // SMULL2 Vd.4S,Vn.8H,Vm.8H
^
armv8.h:37:1: error: 'gnu_inline' attribute without 'extern' in C++ treated as externally available, this changed in Clang 10 [-Werror,-Wgnu-inline-cpp-without-extern]
_NEON2SSE_INLINE int32x4_t
^
armv8.h:42:1: error: 'gnu_inline' attribute without 'extern' in C++ treated as externally available, this changed in Clang 10 [-Werror,-Wgnu-inline-cpp-without-extern]
_NEON2SSE_INLINE int32x4_t vaddl_high_s16(int16x8_t a, int16x8_t b) { // SADDL2 Vd.4S,Vn.8H,Vm.8H
^
armv8.h:32:1: error: 'gnu_inline' attribute without 'extern' in C++ treated as externally available, this changed in Clang 10 [-Werror,-Wgnu-inline-cpp-without-extern]
_NEON2SSE_INLINE int32x4_t vmull_high_s16(int16x8_t a, int16x8_t b) { // SMULL2 Vd.4S,Vn.8H,Vm.8H
^
armv8.h:37:1: error: 'gnu_inline' attribute without 'extern' in C++ treated as externally available, this changed in Clang 10 [-Werror,-Wgnu-inline-cpp-without-extern]
_NEON2SSE_INLINE int32x4_t
^

Switching

#       define _NEON2SSE_INLINE _NEON2SSESTORAGE inline __attribute__((__gnu_inline__, __always_inline__))

to

#       define _NEON2SSE_INLINE extern inline __attribute__((__gnu_inline__, __always_inline__))

appears to solve the problem, but I don't know if this is the best approach.

@Zvictoria
Copy link
Contributor

Thanks for reporting! I will look into that but don't promise it will be soon enough. Looks like your change makes the trick indeed, but need to check it.

@sherpya
Copy link

sherpya commented Jan 1, 2022

by reading some doc I realized it would be better to remove gnu__inline instead

@r-barnes
Copy link
Author

r-barnes commented Jan 2, 2022

@sherpya : Would you like me to amend the PR to do this?

@Zvictoria
Copy link
Contributor

@r-barnes and @sherpya while I'm still busy with other projects far from LLVM, I'm fine with any of you providing any PR shaped solution that you check on the LLVM in question =LLVM 12 and on some earlier one as well, then I'll accept it for sure.

@sherpya
Copy link

sherpya commented Jan 22, 2022

@r-barnes a PR would be simple, we just need to decide, I've found this discussion so far:
https://reviews.llvm.org/D67414
and I realized to remove gnu_inline
I've not found problems so far, what do you think?

@yairfine
Copy link

Hi @Zvictoria @sherpya @r-barnes. Any conclusion so far for this? Still happens with clang on MacOS

@Zvictoria
Copy link
Contributor

Hi, @yairfine On my OS (Windows :) ) LLVM 12.0 compiler everything fine as is. I've done some simple tests on Ubuntu 20.4- looks like removing gnu_inline is fine, so do you have any other LLVM versions tests?

@yairfine
Copy link

@Zvictoria Thank you for your reply! removing gnu_inline indeed solved the issue, but I wondered why was it happening in the first place, and whether it effects performance or not.

@Zvictoria
Copy link
Contributor

@yairfine while I have no clue on why it happens in LLVM12, if it really removes inlining (it might not however :) then if influence performance negatively indeed - I've seen the cases with up to 5% loss. So I'd prefer not to upstream it for now. Good it solves the problem for you however.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@sherpya @r-barnes @Zvictoria @yairfine and others