Tablegen seg faulted when parsing a Pat where the destination part has
no output (zero instruction), due to a register class lookup using
nullptr.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/test/TableGen/GlobalISelEmitter-zero-instr.td | ||
---|---|---|
7 | Nice that we no longer crash, but I don't know how relevant this check is. What about checking that we get the "warning: Skipped pattern: Dst pattern root isn't a known leaf" message instead? |
llvm/test/TableGen/GlobalISelEmitter-zero-instr.td | ||
---|---|---|
7 | That'd be nice, but can it be done? I'm not very familiar with FileCheck... |
llvm/test/TableGen/GlobalISelEmitter-zero-instr.td | ||
---|---|---|
7 | I missed to mention that this check at least checks that we no longer crashes, so it's not entirely useless. |
llvm/test/TableGen/GlobalISelEmitter-zero-instr.td | ||
---|---|---|
7 | One solution could be to do -o /dev/null and ... 2>&1 | FileCheck %s, to simply ignore regular output, and FileCheck on both stdout and stderr (in case the warning is printed on stderr). I'm not sure exactly how tblgen emit those warnings, which stream, or if it is conditional based on how the binary is built (e.g. using -debug in test cases usually also require that you add // REQUIRES: asserts to avoid running the test case when debug support isn't included. But I think that simply checking for the warning would work here. FileCheck is just doing pattern matching on it's input. |
Nice that we no longer crash, but I don't know how relevant this check is. What about checking that we get the "warning: Skipped pattern: Dst pattern root isn't a known leaf" message instead?