[llvm] [CodeGen] Use range-based for loops (NFC) (PR #138434)

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Sun May 4 13:24:53 PDT 2025


nico wrote:

This makes `llc -mtriple=amdgcn -mcpu=tahiti -verify-machineinstrs -amdgpu-remove-redundant-endcf -amdgpu-codegenprepare-break-large-phis=0 < /Users/thakis/src/llvm-project/llvm/test/CodeGen/AMDGPU/collapse-endcf.ll` crash for me on macOS:

```
...
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 2
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /Users/thakis/src/llvm-project/out/gn/bin/llc -mtriple=amdgcn -mcpu=tahiti -verify-machineinstrs -amdgpu-remove-redundant-endcf -amdgpu-codegenprepare-break-large-phis=0
1.	Running pass 'CallGraph Pass Manager' on module '<stdin>'.
2.	Running pass 'Rename Disconnected Subregister Components' on function '@scc_liveness'
 #0 0x000000010596b76c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/Users/thakis/src/llvm-project/out/gn/bin/llc+0x1011e376c)
 #1 0x00000001059694b4 llvm::sys::RunSignalHandlers() (/Users/thakis/src/llvm-project/out/gn/bin/llc+0x1011e14b4)
 #2 0x000000010596bdf4 SignalHandler(int, __siginfo*, void*) (/Users/thakis/src/llvm-project/out/gn/bin/llc+0x1011e3df4)
 #3 0x000000019caaf624 (/usr/lib/system/libsystem_platform.dylib+0x1804ab624)
 #4 0x0000000104efe384 (anonymous namespace)::RenameIndependentSubregs::run(llvm::MachineFunction&) (/Users/thakis/src/llvm-project/out/gn/bin/llc+0x100776384)
 #5 0x0000000104eff224 (anonymous namespace)::RenameIndependentSubregsLegacy::runOnMachineFunction(llvm::MachineFunction&) (/Users/thakis/src/llvm-project/out/gn/bin/llc+0x100777224)
 #6 0x0000000104c97fc8 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/Users/thakis/src/llvm-project/out/gn/bin/llc+0x10050ffc8)
 #7 0x00000001055675f0 llvm::FPPassManager::runOnFunction(llvm::Function&) (/Users/thakis/src/llvm-project/out/gn/bin/llc+0x100ddf5f0)
 #8 0x0000000104fadf28 (anonymous namespace)::CGPassManager::runOnModule(llvm::Module&) (/Users/thakis/src/llvm-project/out/gn/bin/llc+0x100825f28)
 #9 0x0000000105567fd0 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/Users/thakis/src/llvm-project/out/gn/bin/llc+0x100ddffd0)
#10 0x00000001047902dc main (/Users/thakis/src/llvm-project/out/gn/bin/llc+0x1000082dc)
#11 0x000000019c6d6b4c 
zsh: segmentation fault  /Users/thakis/src/llvm-project/out/gn/bin/llc -mtriple=amdgcn -mcpu=tahiti
```

Also on my bot: http://45.33.8.238/macm1/105950/step_10.txt

Bisects to this change, and the crash goes away if I locally revert this commit.


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


More information about the llvm-commits mailing list