[llvm] [NFC][AMDGPU] Do not flush after printing every instruction (PR #95237)

Ivan Kosarev via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 20 04:54:22 PDT 2024


kosarev wrote:

This causes MC/Disassembler/AMDGPU/decode-err.txt to fail in amd-gfx11-true16 downstream. Same reason -- stderr is getting flushed before there's enough to flush to stdout, which doesn't agree with the order of the check lines there.

> I think the right move in the end is to move all those `CHECK: error` to check for actual line numbers using `:[[@LINE+1]]:{{[0-9]+}}:` which is the usual pattern I see for this kind of stuff.

I don't see how this resolves the problem. Given two streams are getting flushed interleaved at random points, it's not even guaranteed that the combined output contains complete lines. Also not going to work where check lines match both stdout and stderr and thus expect them to come in a particular order.

> Or, only flush stdout just before emitting an error message to stderr???

I would prefer that to having extra run lines. I remember introducing a utility, called errcat, for one of LLVM-based projects in the past that collects output from the streams and combines them such that the stderr part always come after the stdout one, which worked well.

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


More information about the llvm-commits mailing list