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

Using veor3q_u64 compiler intrinsic crashes the compiler on M1 Max #78801

Open
CharlesJS opened this issue Jan 22, 2025 · 0 comments
Open

Using veor3q_u64 compiler intrinsic crashes the compiler on M1 Max #78801

CharlesJS opened this issue Jan 22, 2025 · 0 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. crash Bug: A crash, i.e., an abnormal termination of software triage needed This issue needs more specific labels

Comments

@CharlesJS
Copy link

Description

Using the veor3q_u64 compiler intrinsic seems to cause the Swift compiler to crash on my M1 Max MBP.

Reproduction

import _Builtin_intrinsics.arm.neon

let v1 = SIMD2<UInt64>(1, 2)
let v2 = SIMD2<UInt64>(3, 4)
let v3 = SIMD2<UInt64>(5, 6)

let v4 = veor3q_u64(v1, v2, v3) // KABOOM

Stack dump

$ swiftc crasher.swift
error: compile command failed due to signal 6 (use -v to see invocation)
<unknown>:0: error: fatal error encountered during compilation; please submit a bug report (https://swift.org/contributing/#reporting-bugs)
<unknown>:0: note: Cannot select: intrinsic <<INTERNAL ERROR: unparseable argument index in diagnostic text>>.aarch64.crypto.eor3u
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump:
0.	Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c -primary-file crasher.swift -target arm64-apple-macosx15.0 -Xllvm -aarch64-use-tbi -enable-objc-interop -stack-check -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk -color-diagnostics -new-driver-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-driver -empty-abi-descriptor -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift -module-name crasher -disable-clang-spi -target-sdk-version 15.2 -target-sdk-name macosx15.2 -external-plugin-path /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/local/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/lib/swift/host/plugins -o /var/folders/g6/zbq2j7rj5z989zyn6d2d1shr0000gn/T/TemporaryDirectory.8nHgBf/crasher-1.o
1.	Apple Swift version 6.0.3 (swiftlang-6.0.3.1.10 clang-1600.0.30.1)
2.	Compiling with effective version 5.10
3.	Running pass 'Function Pass Manager' on module '/var/folders/g6/zbq2j7rj5z989zyn6d2d1shr0000gn/T/TemporaryDirectory.8nHgBf/crasher-1.o'.
4.	Running pass 'AArch64 Instruction Selection' on function '@main'
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  swift-frontend           0x0000000105992a9c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  swift-frontend           0x0000000105990cf0 llvm::sys::RunSignalHandlers() + 112
2  swift-frontend           0x0000000105993068 SignalHandler(int) + 292
3  libsystem_platform.dylib 0x000000019d8fae04 _sigtramp + 56
4  libsystem_pthread.dylib  0x000000019d8c3f70 pthread_kill + 288
5  libsystem_c.dylib        0x000000019d7d0908 abort + 128
6  swift-frontend           0x00000001006f3ce8 createDispatchingDiagnosticConsumerIfNeeded(swift::FrontendInputsAndOutputs const&, llvm::function_ref<std::__1::unique_ptr<swift::DiagnosticConsumer, std::__1::default_delete<swift::DiagnosticConsumer>> (swift::InputFile const&)>) + 0
7  swift-frontend           0x0000000105902820 llvm::report_fatal_error(llvm::Twine const&, bool) + 280
8  swift-frontend           0x00000001028e3358 llvm::SelectionDAGISel::SelectInlineAsmMemoryOperand(llvm::SDValue const&, unsigned int, std::__1::vector<llvm::SDValue, std::__1::allocator<llvm::SDValue>>&) + 0
9  swift-frontend           0x00000001028e2724 llvm::SelectionDAGISel::SelectCodeCommon(llvm::SDNode*, unsigned char const*, unsigned int) + 17388
10 swift-frontend           0x0000000102481264 (anonymous namespace)::AArch64DAGToDAGISel::Select(llvm::SDNode*) + 11268
11 swift-frontend           0x00000001028dccf8 llvm::SelectionDAGISel::CodeGenAndEmitDAG() + 3004
12 swift-frontend           0x00000001028d9b5c llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) + 10004
13 swift-frontend           0x00000001028d6450 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 2020
14 swift-frontend           0x00000001033f977c llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 704
15 swift-frontend           0x0000000105698e04 llvm::FPPassManager::runOnFunction(llvm::Function&) + 1128
16 swift-frontend           0x00000001056a13b4 llvm::FPPassManager::runOnModule(llvm::Module&) + 60
17 swift-frontend           0x0000000105699a48 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 2452
18 swift-frontend           0x000000010092ae04 swift::compileAndWriteLLVM(llvm::Module*, llvm::TargetMachine*, swift::IRGenOptions const&, swift::UnifiedStatsReporter*, swift::DiagnosticEngine&, llvm::raw_pwrite_stream&, llvm::sys::SmartMutex<false>*, llvm::raw_pwrite_stream*) + 648
19 swift-frontend           0x000000010092a7a8 swift::performLLVM(swift::IRGenOptions const&, swift::DiagnosticEngine&, llvm::sys::SmartMutex<false>*, llvm::GlobalVariable*, llvm::Module*, llvm::TargetMachine*, llvm::StringRef, llvm::vfs::OutputBackend&, swift::UnifiedStatsReporter*) + 3552
20 swift-frontend           0x000000010033f8dc generateCode(swift::CompilerInstance&, llvm::StringRef, llvm::Module*, llvm::GlobalVariable*) + 368
21 swift-frontend           0x000000010033ad70 performCompileStepsPostSILGen(swift::CompilerInstance&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule>>, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, int&, swift::FrontendObserver*) + 2316
22 swift-frontend           0x0000000100339bd0 swift::performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 984
23 swift-frontend           0x000000010033ce88 performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 1684
24 swift-frontend           0x000000010033bbb4 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3572
25 swift-frontend           0x00000001002c2a5c swift::mainEntry(int, char const**) + 3680
26 dyld                     0x000000019d544274 start + 2840

Expected behavior

Either compile the code, or give a compiler error or something if there's a problem

Environment

$ swiftc --version
swift-driver version: 1.115.1 Apple Swift version 6.0.3 (swiftlang-6.0.3.1.10 clang-1600.0.30.1)
Target: arm64-apple-macosx15.0

Additional information

No response

@CharlesJS CharlesJS added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. crash Bug: A crash, i.e., an abnormal termination of software triage needed This issue needs more specific labels labels Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. crash Bug: A crash, i.e., an abnormal termination of software triage needed This issue needs more specific labels
Projects
None yet
Development

No branches or pull requests

1 participant