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

[SR-6813] LLVM 3.8+ emits NEON instructions on non-NEON ARMv7 processors #49362

Open
hpux735 opened this issue Jan 23, 2018 · 5 comments
Open
Labels
armv7 Architecture: ARMv7 bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@hpux735
Copy link
Contributor

hpux735 commented Jan 23, 2018

Previous ID SR-6813
Radar None
Original Reporter @hpux735
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, armv7
Assignee None
Priority Medium

md5: 3fa4c23803f5dcaafdadeec6ac73a90a

Issue Description:

Beginning at LLVM 3.8, LLVM will generate NEON instructions regardless of whether the processor targeted supports these instructions.

According to this (otherwise unrelated) bug report, this should be fixed in LLVM 3.9, however, while building Swift on these platforms, LLVM 3.9 still generates illegal instructions.

[163/2690] Building AttributesCompatFunc.inc...
FAILED: cd /root/buildSwiftOnARM/build/buildbot_linux/llvm-linux-armv7/lib/IR && /root/buildSwiftOnARM/build/buildbot_li
nux/llvm-linux-armv7/bin/llvm-tblgen -gen-attrs -I /root/buildSwiftOnARM/llvm/lib/IR -I /root/buildSwiftOnARM/llvm/inclu
de /root/buildSwiftOnARM/llvm/lib/IR/AttributesCompatFunc.td -o /root/buildSwiftOnARM/build/buildbot_linux/llvm-linux-ar
mv7/lib/IR/AttributesCompatFunc.inc.tmp
Illegal instruction

I have a build system that exhibits this bug on "the cloud" and I will provide a username and password to anyone willing and able to help with this bug.

@compnerd
Copy link
Collaborator

This looks like a bug in the build of LLVM. LLVM can definitely be built on ARM and I believe is done so as part of the buildbot set for LLVM itself.

@hpux735
Copy link
Contributor Author

hpux735 commented Jan 24, 2018

Yes, I see your point. You posit that the llvm-3.8 and llvm-3.9 built and distributed in Debian-armhf are broken?

I will try building from source, and see if the problem persists.

@hpux735
Copy link
Contributor Author

hpux735 commented Feb 2, 2018

Does anyone have "getting started" instructions that work handy? I'm getting a build error on LLVM:

make[2]: *** [lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/LexicalScopes.cpp.o] Error 1
CMakeFiles/Makefile2:1237: recipe for target 'lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/all' failed
make[1]: *** [lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2
root@scw-paris-build-1:~/build#
{{ std::forward_as_tuple(Parent, Scope,}}
{{ ^~~~~~~~~~~~~~~~~~~~~}}
/usr/bin/../lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../include/c++/6.3.0/tuple:1403:5: note: candidate template ignored: substitution failure [with _Elements = <llvm::LexicalScope *&, const llvm::DILocalScope *&, nullptr_t,
{{ bool>]}}
{{ forward_as_tuple(_Elements&&... __args) noexcept}}
{{ ^}}

This is following the instructions from llvm.org

@MaxDesiatov
Copy link
Member

@hpux735 have you been able to reproduce this with more recent versions of Swift?

@hpux735
Copy link
Contributor Author

hpux735 commented Feb 6, 2022

That's a good question. I don't know. We don't have devices that are non-NEON at work anymore, so I don't have a great way to test it.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
armv7 Architecture: ARMv7 bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself
Projects
None yet
Development

No branches or pull requests

3 participants