[llvm] [AMDGPU] Remove definition of hi16 for scalar registers (PR #197467)

Jan Patrick Lehr via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 3 03:25:42 PDT 2026


jplehr wrote:

Hits an `unreachable` in libc on GPU buildbot: https://lab.llvm.org/buildbot/#/builders/10/builds/29355

```
FAILED: libc/test/src/time/libc.test.src.time.strftime_test.__hermetic__.__build__ 
: && /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/./bin/clang++ --target=amdgcn-amd-amdhsa -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 -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Xclang -fno-pch-timestamp -O3 -DNDEBUG -Wl,--color-diagnostics    --target=amdgcn-amd-amdhsa -Wno-multi-gpu -mcpu=native -flto -nostdlib -static -Wl,-mllvm,-amdhsa-code-object-version=6 libc/startup/gpu/CMakeFiles/libc.startup.gpu.crt1.dir/start.cpp.o libc/test/src/time/CMakeFiles/libc.test.src.time.strftime_test.__hermetic__.__build__.dir/strftime_test.cpp.o -o libc/test/src/time/libc.test.src.time.strftime_test.__hermetic__.__build__  libc/test/UnitTest/libLibcTest.hermetic.a  libc/test/UnitTest/libLibcHermeticTestSupport.hermetic.a  libc/test/src/time/liblibc.test.src.time.strftime_test.__hermetic__.libc.a && :
cannot represent required subregister defs
UNREACHABLE executed at /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/llvm/lib/CodeGen/VirtRegMap.cpp:707!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0.	Program arguments: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/ld.lld --no-undefined -shared -plugin-opt=mcpu=gfx90a -plugin-opt=O3 --lto-CGO3 -plugin-opt=-function-sections=1 -plugin-opt=-data-sections=1 -L/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/../lib/amdgcn-amd-amdhsa --color-diagnostics -mllvm -amdhsa-code-object-version=6 libc/startup/gpu/CMakeFiles/libc.startup.gpu.crt1.dir/start.cpp.o libc/test/src/time/CMakeFiles/libc.test.src.time.strftime_test.__hermetic__.__build__.dir/strftime_test.cpp.o libc/test/UnitTest/libLibcTest.hermetic.a libc/test/UnitTest/libLibcHermeticTestSupport.hermetic.a libc/test/src/time/liblibc.test.src.time.strftime_test.__hermetic__.libc.a -o libc/test/src/time/libc.test.src.time.strftime_test.__hermetic__.__build__
1.	Running pass 'CallGraph Pass Manager' on module 'ld-temp.o'.
2.	Running pass 'Virtual Register Rewriter' on function '@_ZN43LlvmLibcStrftimeTest_TimeFormatFullDateTime3RunEv'
 #0 0x00007232dee1b870 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/../lib/libLLVMSupport.so.23.0git+0x21b870)
 #1 0x00007232dee1843c llvm::sys::RunSignalHandlers() (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/../lib/libLLVMSupport.so.23.0git+0x21843c)
 #2 0x00007232dee185a2 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #3 0x00007232de442520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x00007232de4969fc __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
 #5 0x00007232de4969fc __pthread_kill_internal ./nptl/pthread_kill.c:78:10
 #6 0x00007232de4969fc pthread_kill ./nptl/pthread_kill.c:89:10
 #7 0x00007232de442476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
 #8 0x00007232de4287f3 abort ./stdlib/abort.c:81:7
 #9 0x00007232ded0d98e (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/../lib/libLLVMSupport.so.23.0git+0x10d98e)
#10 0x00007232d9be2d6d (anonymous namespace)::VirtRegRewriter::rewrite() VirtRegMap.cpp:0:0
#11 0x00007232d9be33f2 (anonymous namespace)::VirtRegRewriter::run(llvm::MachineFunction&) VirtRegMap.cpp:0:0
#12 0x00007232d9be3cc7 (anonymous namespace)::VirtRegRewriterLegacy::runOnMachineFunction(llvm::MachineFunction&) VirtRegMap.cpp:0:0
#13 0x00007232d97fd99b llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#14 0x00007232da293c31 llvm::FPPassManager::runOnFunction(llvm::Function&) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/../lib/../lib/libLLVMCore.so.23.0git+0x293c31)
#15 0x00007232d7970c82 (anonymous namespace)::CGPassManager::runOnModule(llvm::Module&) CallGraphSCCPass.cpp:0:0
#16 0x00007232da294c30 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/../lib/../lib/libLLVMCore.so.23.0git+0x294c30)
#17 0x00007232def4f6ab codegen(llvm::lto::Config const&, llvm::TargetMachine*, std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream, std::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>, unsigned int, llvm::Module&, llvm::ModuleSummaryIndex const&) LTOBackend.cpp:0:0
#18 0x00007232def5160d llvm::lto::backend(llvm::lto::Config const&, std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream, std::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>, unsigned int, llvm::Module&, llvm::ModuleSummaryIndex&, llvm::ArrayRef<llvm::StringRef>) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/../lib/../lib/libLLVMLTO.so.23.0git+0x5360d)
#19 0x00007232def29768 llvm::lto::LTO::runRegularLTO(std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream, std::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/../lib/../lib/libLLVMLTO.so.23.0git+0x2b768)
#20 0x00007232def41da6 llvm::lto::LTO::run(std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream, std::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>, llvm::FileCache) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/../lib/../lib/libLLVMLTO.so.23.0git+0x43da6)
#21 0x00007232df5e5d8a lld::elf::BitcodeCompiler::compile() (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/../lib/liblldELF.so.23.0git+0x1e5d8a)
#22 0x00007232df527f15 void lld::elf::LinkerDriver::compileBitcodeFiles<llvm::object::ELFType<(llvm::endianness)1, true>>(bool) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/../lib/liblldELF.so.23.0git+0x127f15)
#23 0x00007232df559533 void lld::elf::LinkerDriver::link<llvm::object::ELFType<(llvm::endianness)1, true>>(llvm::opt::InputArgList&) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/../lib/liblldELF.so.23.0git+0x159533)
#24 0x00007232df561369 lld::elf::LinkerDriver::linkerMain(llvm::ArrayRef<char const*>) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/../lib/liblldELF.so.23.0git+0x161369)
#25 0x00007232df56192e lld::elf::link(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, bool, bool) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/../lib/liblldELF.so.23.0git+0x16192e)
#26 0x00007232df0ec5b1 lld::unsafeLldMain(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, llvm::ArrayRef<lld::DriverDef>, bool) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/../lib/liblldCommon.so.23.0git+0xe5b1)
#27 0x00005954b91cbcb6 lld_main(int, char**, llvm::ToolContext const&) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/ld.lld+0x2cb6)
#28 0x00005954b91cb53e main (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/ld.lld+0x253e)
#29 0x00007232de429d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#30 0x00007232de429e40 call_init ./csu/../csu/libc-start.c:128:20
#31 0x00007232de429e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#32 0x00005954b91cb595 _start (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/ld.lld+0x2595)
clang++: error: unable to execute command: Aborted (core dumped)
clang++: error: ld.lld command failed with exit code -2 (use -v to see invocation)
Aborted (core dumped)
```

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


More information about the llvm-commits mailing list