Page MenuHomePhabricator

[MLIR] Support for holistic logging of lowerings in test cases

Authored by frgossen on Aug 28 2020, 1:38 AM.



All lowerings that take place during test execution will be recorded in log
files if the macro LOG_LOWERINGS is defined at compile time. This allows to
capture also lowerings that happen in child processes. If the macro remains
undefined, MLIR will behave exactly as before.

Diff Detail

Event Timeline

frgossen created this revision.Aug 28 2020, 1:38 AM
Herald added a project: Restricted Project. · View Herald Transcript
frgossen requested review of this revision.Aug 28 2020, 1:38 AM

Using #ifdef's isn't great. Can we instead have a cl::opt and just use a regular if to control this. Then we can test it too.

I know, defining this with a macro (instead of cl::opt) feels a bit odd, just like writing all these files instead of printing it to the debug stream.
I considered both, however, there was no way to pass the flag on to all of the pattern applications among the test cases. Especially in the lit tests I would not know how to do this; the debug stream is consumed by, e.g. file-check and the flags are defined in the lit files.

If the aim is to collect all pattern applications, this is still the only way I can think of. If instead this is a debugging feature, we could do it with a simple flag.

silvas resigned from this revision.Oct 29 2020, 3:07 PM
frgossen abandoned this revision.May 17 2021, 3:08 AM