[llvm] [AArch64] Add CSEL for canCreateUndefOrPoisonForTargetNode (PR #226946)

David Spickett via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 1 02:01:36 PDT 2026


DavidSpickett wrote:

I don't have a bisect result but I'm pretty sure this is breaking second stage builds on AArch64 - https://lab.llvm.org/buildbot/#/builders/199/builds/11117.
```
FAILED: lib/Support/CMakeFiles/LLVMSupport.dir/ScaledNumber.cpp.o 
/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage1.install/bin/clang++ -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GLIBCXX_USE_CXX11_ABI=1 -D_GNU_SOURCE -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage2/lib/Support -I/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/llvm/llvm/lib/Support -I/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage2/include -I/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/llvm/llvm/include -I/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/llvm/llvm/../third-party/siphash/include -I/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/llvm/llvm/../libc -mcpu=neoverse-v2 -mllvm -scalable-vectorization=preferred -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Xclang -fno-pch-timestamp -Werror=global-constructors -O3 -DNDEBUG -std=c++17 -UNDEBUG -fno-exceptions -funwind-tables -fno-rtti -Wno-c99-extensions -Winvalid-pch -Xclang -include-pch -Xclang /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage2/lib/Support/CMakeFiles/LLVMSupport.dir/cmake_pch.hxx.pch -Xclang -include -Xclang /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage2/lib/Support/CMakeFiles/LLVMSupport.dir/cmake_pch.hxx -MD -MT lib/Support/CMakeFiles/LLVMSupport.dir/ScaledNumber.cpp.o -MF lib/Support/CMakeFiles/LLVMSupport.dir/ScaledNumber.cpp.o.d -o lib/Support/CMakeFiles/LLVMSupport.dir/ScaledNumber.cpp.o -c /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/llvm/llvm/lib/Support/ScaledNumber.cpp
clang++: /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/llvm/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp:6418: void llvm::AArch64InstrInfo::copyPhysRegImpl(MachineBasicBlock &, MachineBasicBlock::iterator, const DebugLoc &, Register, Register, bool, bool, bool) const: Assertion `AArch64::GPR64RegClass.contains(DestReg) && "Invalid NZCV copy"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and dumped files.
Stack dump:
0.	Program arguments: /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage1.install/bin/clang++ -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GLIBCXX_USE_CXX11_ABI=1 -D_GNU_SOURCE -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage2/lib/Support -I/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/llvm/llvm/lib/Support -I/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage2/include -I/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/llvm/llvm/include -I/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/llvm/llvm/../third-party/siphash/include -I/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/llvm/llvm/../libc -mcpu=neoverse-v2 -mllvm -scalable-vectorization=preferred -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Xclang -fno-pch-timestamp -Werror=global-constructors -O3 -DNDEBUG -std=c++17 -UNDEBUG -fno-exceptions -funwind-tables -fno-rtti -Wno-c99-extensions -Winvalid-pch -Xclang -include-pch -Xclang /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage2/lib/Support/CMakeFiles/LLVMSupport.dir/cmake_pch.hxx.pch -Xclang -include -Xclang /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage2/lib/Support/CMakeFiles/LLVMSupport.dir/cmake_pch.hxx -MD -MT lib/Support/CMakeFiles/LLVMSupport.dir/ScaledNumber.cpp.o -MF lib/Support/CMakeFiles/LLVMSupport.dir/ScaledNumber.cpp.o.d -o lib/Support/CMakeFiles/LLVMSupport.dir/ScaledNumber.cpp.o -c /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/llvm/llvm/lib/Support/ScaledNumber.cpp
1.	<eof> parser at end of file
2.	Code generation
3.	Running pass 'Function Pass Manager' on module '/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/llvm/llvm/lib/Support/ScaledNumber.cpp'.
4.	Running pass 'Post-RA pseudo instruction expansion pass' on function '@_ZN4llvm13ScaledNumbers10multiply64Emm'
 #0 0x0000aec09a3bdbc0 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage1.install/bin/clang+++0x9addbc0)
 #1 0x0000aec09a3bb058 llvm::sys::RunSignalHandlers() (/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage1.install/bin/clang+++0x9adb058)
 #2 0x0000aec09a3bc974 llvm::sys::CleanupOnSignal(unsigned long) (/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage1.install/bin/clang+++0x9adc974)
 #3 0x0000aec09a313484 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #4 0x0000e896e6972a60 (linux-vdso.so.1+0xa60)
 #5 0x0000e896e64a2008 __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
 #6 0x0000e896e645a83c gsignal ./signal/../sysdeps/posix/raise.c:27:6
 #7 0x0000e896e6447134 abort ./stdlib/abort.c:81:7
 #8 0x0000e896e6454114 __assert_fail_base ./assert/assert.c:91:7
 #9 0x0000e896e645418c (/lib/aarch64-linux-gnu/libc.so.6+0x3418c)
#10 0x0000aec0974fac64 llvm::AArch64InstrInfo::copyPhysRegImpl(llvm::MachineBasicBlock&, llvm::MachineInstrBundleIterator<llvm::MachineInstr, false>, llvm::DebugLoc const&, llvm::Register, llvm::Register, bool, bool, bool) const AArch64InstrInfo.cpp:0:0
#11 0x0000aec0999edb8c llvm::TargetInstrInfo::lowerCopy(llvm::MachineInstr*, llvm::TargetRegisterInfo const*) const (/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage1.install/bin/clang+++0x910db8c)
#12 0x0000aec099a5cdb8 (anonymous namespace)::ExpandPostRA::run(llvm::MachineFunction&) ExpandPostRAPseudos.cpp:0:0
#13 0x0000aec099a5d414 (anonymous namespace)::ExpandPostRALegacy::runOnMachineFunction(llvm::MachineFunction&) ExpandPostRAPseudos.cpp:0:0
#14 0x0000aec099721fbc llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage1.install/bin/clang+++0x8e41fbc)
#15 0x0000aec099d07d40 llvm::FPPassManager::runOnFunction(llvm::Function&) (/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage1.install/bin/clang+++0x9427d40)
#16 0x0000aec099d0fbdc llvm::FPPassManager::runOnModule(llvm::Module&) (/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage1.install/bin/clang+++0x942fbdc)
#17 0x0000aec099d08a84 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage1.install/bin/clang+++0x9428a84)
#18 0x0000aec09bbc26c4 llvm::runCodeGenPipeline(llvm::TargetMachine&, llvm::Module&, llvm::raw_pwrite_stream&, std::unique_ptr<llvm::ToolOutputFile, std::default_delete<llvm::ToolOutputFile>>&, llvm::CodeGenFileType, bool, bool, bool, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>) (/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage1.install/bin/clang+++0xb2e26c4)
#19 0x0000aec09acf7d20 (anonymous namespace)::EmitAssemblyHelper::emitAssembly(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>, clang::BackendConsumer*) BackendUtil.cpp:0:0
#20 0x0000aec09acf679c clang::emitBackendOutput(clang::CompilerInstance&, clang::CodeGenOptions&, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>, clang::BackendConsumer*) (/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage1.install/bin/clang+++0xa41679c)
#21 0x0000aec09ad0cd3c clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage1.install/bin/clang+++0xa42cd3c)
#22 0x0000aec09c6bac30 clang::ParseAST(clang::Sema&, bool, bool) (/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage1.install/bin/clang+++0xbddac30)
#23 0x0000aec09b221c70 clang::FrontendAction::Execute() (/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage1.install/bin/clang+++0xa941c70)
#24 0x0000aec09b1a0b48 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage1.install/bin/clang+++0xa8c0b48)
#25 0x0000aec09b2e35b0 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage1.install/bin/clang+++0xaa035b0)
#26 0x0000aec0974c8674 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage1.install/bin/clang+++0x6be8674)
#27 0x0000aec0974c4d9c ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>) driver.cpp:0:0
#28 0x0000aec0974c6ecc int llvm::function_ref<int (llvm::SmallVectorImpl<char const*>&)>::callback_fn<clang_main(int, char**, llvm::ToolContext const&)::$_0>(long, llvm::SmallVectorImpl<char const*>&) driver.cpp:0:0
#29 0x0000aec09b009ce0 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::$_0>(long) Job.cpp:0:0
#30 0x0000aec09a31314c llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage1.install/bin/clang+++0x9a3314c)
#31 0x0000aec09b00920c clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage1.install/bin/clang+++0xa72920c)
#32 0x0000aec09afc69c8 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage1.install/bin/clang+++0xa6e69c8)
#33 0x0000aec09afc75b8 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage1.install/bin/clang+++0xa6e75b8)
#34 0x0000aec09afe6b10 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage1.install/bin/clang+++0xa706b10)
#35 0x0000aec0974c418c clang_main(int, char**, llvm::ToolContext const&) (/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage1.install/bin/clang+++0x6be418c)
#36 0x0000aec0974d3970 main (/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage1.install/bin/clang+++0x6bf3970)
#37 0x0000e896e6447400 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:74:3
#38 0x0000e896e64474d8 call_init ./csu/../csu/libc-start.c:128:20
#39 0x0000e896e64474d8 __libc_start_main ./csu/../csu/libc-start.c:379:5
#40 0x0000aec0974c2630 _start (/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage1.install/bin/clang+++0x6be2630)
clang++: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 24.0.0git (https://github.com/llvm/llvm-project.git d7e4505dd447d115d85fdea45cd71030ac1d86ee)
Target: aarch64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage1.install/bin
Build config: +assertions
clang++: note: diagnostic msg: 
```

https://github.com/llvm/llvm-project/pull/226946


More information about the llvm-commits mailing list