[llvm-dev] [RFC] New diagnostic handler for llc

Renato Golin via llvm-dev llvm-dev at lists.llvm.org
Thu May 12 06:26:09 PDT 2016

On 12 May 2016 at 14:19, Krzysztof Parzyszek via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> The problem is that when we try to recover from an error in the backend, the
> recovery itself could potentially cause further erroneous situations.  For
> example, if you generate an "undef" value for something you cannot
> meaningfully create otherwise, some code down the road may assert claiming
> that it did not expect an "undef" at this point.  That may be a completely
> reasonable assertion, given an assumption that invalid input should have
> been rejected earlier on.

I don't think the proposal is about transforming every llc error
handling into using the Diagnostics, only those that the back-ends
already use, but llc has no way to capture today.

The fact that diagnostics don't fail immediately is a consequence of
the type of the error, not the error handling.

> The problem in PR24071 seemed to be that clang proceeded with compilation
> even though the inline asm was not valid.  I'm not sure that there is value
> in trying to make the backend continue compiling code that most likely has
> no meaning.

For the particular cases we're talking about (inline asm), it's not
about continuing or not, but about getting the right context.

Errors in the inline asm can be exposed by errors in the program
itself, and having all errors printed at once, even in llc, can be
very helpful in identifying the underlying problem.

This is also very helpful when creating tests (which is the primary
case for llc), to make sure the inline asm is doing what you think it


More information about the llvm-dev mailing list