This is an archive of the discontinued LLVM Phabricator instance.

[mlir][NFC] Refactor DialectConversion debug logging
ClosedPublic

Authored by rriddle on Jan 30 2020, 2:48 PM.

Details

Summary

This revision beefs up the debug logging within dialect conversion. Given the nature of multi-level legalization, and legalization in general, it is one of the harder pieces of infrastructure to debug. This revision adds nice formatting to make the output log easier to parse:

Legalizing operation : 'std.constant'(0x608000002420) {
  * Fold {
  } -> FAILURE : unable to fold

  * Pattern : 'std.constant -> ()' {
  } -> FAILURE : pattern failed to match

  * Pattern : 'std.constant -> ()' {
  } -> FAILURE : pattern failed to match

  * Pattern : 'std.constant -> (spv.constant)' {
    ** Insert  : 'spv.constant'(0x608000002c20)
    ** Replace : 'std.constant'(0x608000002420)

    //===-------------------------------------------===//
    Legalizing operation : 'spv.constant'(0x608000002c20) {
    } -> SUCCESS : operation marked legal by the target
    //===-------------------------------------------===//
  } -> SUCCESS : pattern applied successfully
} -> SUCCESS

Diff Detail

Event Timeline

rriddle created this revision.Jan 30 2020, 2:48 PM
nicolasvasilache accepted this revision.Jan 30 2020, 3:16 PM

Very cool, thanks a lot for this!

This revision is now accepted and ready to land.Jan 30 2020, 3:16 PM

Unit tests: pass. 62303 tests passed, 0 failed and 838 were skipped.

clang-tidy: pass.

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

rriddle edited the summary of this revision. (Show Details)Jan 30 2020, 4:34 PM
This revision was automatically updated to reflect the committed changes.