Skip to content

Conversation

kubamracek
Copy link
Contributor

This is particularly relevant for the Pico (the MCU is RP2040, which is Cortex-M0+, which is ARMv6-M).

@kubamracek
Copy link
Contributor Author

I think this will fail to build due to a clang crash, but I'll use this PR to track the progress on that.

@kubamracek
Copy link
Contributor Author

@swift-ci please test

@kubamracek
Copy link
Contributor Author

I think this is the relevant missing piece in LLVM: https://reviews.llvm.org/D49465
Looks like Thumb1 targets don't have tail cails support in LLVM, and Cortex-M0+ is Thumb1...

@kubamracek
Copy link
Contributor Author

@swift-ci please test

@kubamracek
Copy link
Contributor Author

FAILED: stdlib/public/Concurrency/CMakeFiles/embedded-concurrency-armv6m-apple-none-macho.dir/AsyncLet.cpp.o 
/usr/local/bin/sccache /Users/ec2-user/jenkins/workspace/swift-PR-macos/branch-main/build/buildbot_incremental/llvm-macosx-x86_64/./bin/clang++ ... -c /Users/ec2-user/jenkins/workspace/swift-PR-macos/branch-main/swift/stdlib/public/Concurrency/AsyncLet.cpp
fatal error: error in backend: failed to perform tail call elimination on a call site marked musttail
...
1.	<eof> parser at end of file
2.	Code generation
3.	Running pass 'Function Pass Manager' on module '/Users/ec2-user/jenkins/workspace/swift-PR-macos/branch-main/swift/stdlib/public/Concurrency/AsyncLet.cpp'.
4.	Running pass 'ARM Instruction Selection' on function '@swift_asyncLet_get'
 #0 0x00000001093d4748 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
 #1 0x00000001093d2659 llvm::sys::RunSignalHandlers()
 #2 0x00000001093d3c91 llvm::sys::CleanupOnSignal(unsigned long)
 #3 0x000000010931f49e (anonymous namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long)
 #4 0x000000010931f423 llvm::CrashRecoveryContext::HandleExit(int)
 #5 0x00000001093cf24c llvm::sys::Process::Exit(int, bool)
 #6 0x000000010374a667 LLVMErrorHandler(void*, char const*, bool)
 #7 0x000000010932a1f8 llvm::report_fatal_error(llvm::Twine const&, bool)
 #8 0x000000010932a099 llvm::report_fatal_error(char const*, bool)
 #9 0x0000000103c3573b llvm::ARMTargetLowering::LowerCall(llvm::TargetLowering::CallLoweringInfo&, llvm::SmallVectorImpl<llvm::SDValue>&) const
#10 0x0000000104abe7ec llvm::TargetLowering::LowerCallTo(llvm::TargetLowering::CallLoweringInfo&) const
#11 0x0000000104adf952 llvm::SelectionDAGBuilder::lowerInvokable(llvm::TargetLowering::CallLoweringInfo&, llvm::BasicBlock const*)
#12 0x0000000104ac6eb3 llvm::SelectionDAGBuilder::LowerCallTo(llvm::CallBase const&, llvm::SDValue, bool, bool, llvm::BasicBlock const*, llvm::TargetLowering::PtrAuthInfo const*)
#13 0x0000000104aafb9a llvm::SelectionDAGBuilder::visitCall(llvm::CallInst const&)
#14 0x0000000104aa2db9 llvm::SelectionDAGBuilder::visit(llvm::Instruction const&)
...

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

Successfully merging this pull request may close these issues.

2 participants