[llvm] AMDGPU: Use LiveIntervals instead of LiveVariables in SIOptimizeVGPRLiveRange (PR #227252)

Jan Patrick Lehr via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 30 06:01:29 PDT 2026


jplehr wrote:

The bot is still red with this stack trace

```
FAILED: libc/test/src/time/libc.test.src.time.strftime_test.__build__ 
: && /home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/clang++ --target=amdgpu-amd-amdhsa -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 -Wno-comment -Wstring-conversion -Wno-pass-failed -fdiagnostics-color -ffunction-sections -fdata-sections -Xclang -fno-pch-timestamp -O3 -DNDEBUG -Wl,--color-diagnostics    --target=amdgpu-amd-amdhsa -Wno-multi-gpu -mcpu=native -flto -nostdlib -static -Wl,-mllvm,-amdhsa-code-object-version=6 -Xlinker --dependency-file=libc/test/src/time/CMakeFiles/libc.test.src.time.strftime_test.__build__.dir/link.d libc/startup/gpu/CMakeFiles/libc.startup.gpu.crt1.dir/start.cpp.o libc/test/src/time/CMakeFiles/libc.test.src.time.strftime_test.__build__.dir/strftime_test.cpp.o -o libc/test/src/time/libc.test.src.time.strftime_test.__build__  libc/test/src/time/liblibc.test.src.time.strftime_test.libc.a && :
ld.lld: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/llvm/lib/CodeGen/LiveInterval.cpp:597: void llvm::LiveRange::removeSegment(llvm::SlotIndex, llvm::SlotIndex, bool): Assertion `I->containsInterval(Start, End) && "Segment is not entirely in range!"' failed.
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/build/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/build/llvm.build/bin/../lib/amdgpu-amd-amdhsa -L/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/lib/clang/24/lib/amdgpu-amd-amdhsa --color-diagnostics -mllvm -amdhsa-code-object-version=6 --dependency-file=libc/test/src/time/CMakeFiles/libc.test.src.time.strftime_test.__build__.dir/link.d libc/startup/gpu/CMakeFiles/libc.startup.gpu.crt1.dir/start.cpp.o libc/test/src/time/CMakeFiles/libc.test.src.time.strftime_test.__build__.dir/strftime_test.cpp.o libc/test/src/time/liblibc.test.src.time.strftime_test.libc.a -o libc/test/src/time/libc.test.src.time.strftime_test.__build__
1.	Running pass 'CallGraph Pass Manager' on module 'ld-temp.o'.
2.	Running pass 'Eliminate PHI nodes for register allocation' on function '@_ZN43LlvmLibcStrftimeTest_TimeFormatFullDateTime3RunEv'
 #0 0x00007b8f982234c9 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/../lib/libLLVMSupport.so.24.0git+0x2234c9)
 #1 0x00007b8f982201bc llvm::sys::RunSignalHandlers() (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/../lib/libLLVMSupport.so.24.0git+0x2201bc)
 #2 0x00007b8f98220326 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #3 0x00007b8f97842520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x00007b8f978969bc __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
 #5 0x00007b8f978969bc __pthread_kill_internal ./nptl/pthread_kill.c:78:10
 #6 0x00007b8f978969bc pthread_kill ./nptl/pthread_kill.c:89:10
 #7 0x00007b8f97842476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
 #8 0x00007b8f978287f3 abort ./stdlib/abort.c:81:7
 #9 0x00007b8f9782871b _nl_load_domain ./intl/loadmsgcat.c:1177:9
#10 0x00007b8f97839e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#11 0x00007b8f92511722 llvm::LiveRange::removeSegment(llvm::SlotIndex, llvm::SlotIndex, bool) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/../lib/../lib/libLLVMCodeGen.so.24.0git+0x311722)
#12 0x00007b8f925578fd llvm::MachineBasicBlock::SplitCriticalEdge(llvm::MachineBasicBlock*, llvm::MachineBasicBlock::SplitCriticalEdgeAnalyses const&, std::vector<llvm::SparseBitVector<128u>, std::allocator<llvm::SparseBitVector<128u>>>*, llvm::MachineDomTreeUpdater*) (.part.0) MachineBasicBlock.cpp:0:0
#13 0x00007b8f925581f7 llvm::MachineBasicBlock::SplitCriticalEdge(llvm::MachineBasicBlock*, llvm::Pass*, llvm::AnalysisManager<llvm::MachineFunction>*, std::vector<llvm::SparseBitVector<128u>, std::allocator<llvm::SparseBitVector<128u>>>*, llvm::MachineDomTreeUpdater*) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/../lib/../lib/libLLVMCodeGen.so.24.0git+0x3581f7)
#14 0x00007b8f9279c9f1 (anonymous namespace)::PHIEliminationImpl::run(llvm::MachineFunction&) PHIElimination.cpp:0:0
#15 0x00007b8f9279f98e (anonymous namespace)::PHIElimination::runOnMachineFunction(llvm::MachineFunction&) PHIElimination.cpp:0:0
#16 0x00007b8f925e35dc llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#17 0x00007b8f930a9466 llvm::FPPassManager::runOnFunction(llvm::Function&) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/../lib/../lib/libLLVMCore.so.24.0git+0x2a9466)
#18 0x00007b8f8f55ac8a (anonymous namespace)::CGPassManager::runOnModule(llvm::Module&) CallGraphSCCPass.cpp:0:0
#19 0x00007b8f930aa421 (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) LegacyPassManager.cpp:0:0
#20 0x00007b8f930aac6b llvm::legacy::PassManagerImpl::run(llvm::Module&) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/../lib/../lib/libLLVMCore.so.24.0git+0x2aac6b)
#21 0x00007b8f97e8a019 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
#22 0x00007b8f97e8c53d 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/build/llvm.build/bin/../lib/../lib/libLLVMLTO.so.24.0git+0x5653d)
#23 0x00007b8f97e5c8a4 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/build/llvm.build/bin/../lib/../lib/libLLVMLTO.so.24.0git+0x268a4)
#24 0x00007b8f97e7c82b 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/build/llvm.build/bin/../lib/../lib/libLLVMLTO.so.24.0git+0x4682b)
#25 0x00007b8f987dffe7 lld::elf::BitcodeCompiler::compile() (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/../lib/liblldELF.so.24.0git+0x1dffe7)
#26 0x00007b8f98733c0d void lld::elf::LinkerDriver::compileBitcodeFiles<llvm::object::ELFType<(llvm::endianness)1, true>>(bool) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/../lib/liblldELF.so.24.0git+0x133c0d)
#27 0x00007b8f98755b7e void lld::elf::LinkerDriver::link<llvm::object::ELFType<(llvm::endianness)1, true>>(llvm::opt::InputArgList&) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/../lib/liblldELF.so.24.0git+0x155b7e)
#28 0x00007b8f98752892 lld::elf::LinkerDriver::linkerMain(llvm::ArrayRef<char const*>) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/../lib/liblldELF.so.24.0git+0x152892)
#29 0x00007b8f9875d41b lld::elf::link(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, bool, bool) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/../lib/liblldELF.so.24.0git+0x15d41b)
#30 0x00007b8f983b17d1 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/build/llvm.build/bin/../lib/liblldCommon.so.24.0git+0xe7d1)
#31 0x000064989e95cd06 lld_main(int, char**, llvm::ToolContext const&) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/ld.lld+0x2d06)
#32 0x000064989e95c587 main (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/ld.lld+0x2587)
#33 0x00007b8f97829d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#34 0x00007b8f97829e40 call_init ./csu/../csu/libc-start.c:128:20
#35 0x00007b8f97829e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#36 0x000064989e95c5e5 _start (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/ld.lld+0x25e5)
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)
```

Could it be related to this patch?
I'm running a local experiment as well.

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


More information about the llvm-commits mailing list