[llvm] [llc][NPM] Use buffer_ostream support for non-seekable streams (PR #168842)

Prasoon Mishra via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 20 19:10:19 PST 2025


PrasoonMishra wrote:

> What kind of assertions? Testcase?

The assertion we hit is:
```
llc: /llvm/lib/Support/raw_ostream.cpp:802: 
uint64_t llvm::raw_fd_ostream::seek(uint64_t): 
Assertion `SupportsSeeking && "Stream does not support seeking!"' failed.
```
Without this fix, several AMDGPU tests fail under NPM, for example:
```
DebugInfo/AMDGPU/pointer-address-space.ll
DebugInfo/AMDGPU/variable-locations.ll
CodeGen/AMDGPU/elf.metadata.ll
CodeGen/AMDGPU/comdat.ll
CodeGen/AMDGPU/hsa-metadata-invalid-ocl-version-1.ll
```
The patch tries to be consistent with [legacy llc.cpp (lines 739–745)](https://github.com/llvm/llvm-project/blob/main/llvm/tools/llc/llc.cpp#L739-L745) to ensure consistent behavior and restore these tests to passing.


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


More information about the llvm-commits mailing list